@laerdal/life-react-components 1.10.3-dev.21 → 1.10.3-dev.22

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 (65) hide show
  1. package/dist/Button/Iconbutton.cjs +5 -0
  2. package/dist/Button/Iconbutton.cjs.map +1 -1
  3. package/dist/Button/Iconbutton.d.ts +7 -1
  4. package/dist/Button/Iconbutton.js +5 -0
  5. package/dist/Button/Iconbutton.js.map +1 -1
  6. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +7 -8
  7. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
  8. package/dist/GlobalNavigationBar/GlobalNavigationBar.d.ts +1 -2
  9. package/dist/GlobalNavigationBar/GlobalNavigationBar.js +6 -7
  10. package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
  11. package/dist/{common → GlobalNavigationBar}/NavigationHelper.cjs +0 -0
  12. package/dist/GlobalNavigationBar/NavigationHelper.cjs.map +1 -0
  13. package/dist/{common → GlobalNavigationBar}/NavigationHelper.d.ts +0 -0
  14. package/dist/{common → GlobalNavigationBar}/NavigationHelper.js +0 -0
  15. package/dist/GlobalNavigationBar/NavigationHelper.js.map +1 -0
  16. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +36 -70
  17. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
  18. package/dist/GlobalNavigationBar/desktop/DesktopActions.js +36 -68
  19. package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
  20. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +21 -46
  21. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
  22. package/dist/GlobalNavigationBar/desktop/MainMenu.js +21 -45
  23. package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
  24. package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs +2 -2
  25. package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
  26. package/dist/GlobalNavigationBar/desktop/RightSideNav.js +2 -2
  27. package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
  28. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +3 -3
  29. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
  30. package/dist/GlobalNavigationBar/desktop/UserMenu.js +3 -3
  31. package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
  32. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs +3 -3
  33. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -1
  34. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js +3 -3
  35. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -1
  36. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs +30 -59
  37. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs.map +1 -1
  38. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js +30 -58
  39. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js.map +1 -1
  40. package/dist/GlobalNavigationBar/types.d.ts +10 -9
  41. package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
  42. package/dist/ProfileButton/ProfileButton.d.ts +0 -8
  43. package/dist/ProfileButton/ProfileButton.js.map +1 -1
  44. package/dist/Table/TableFooter.cjs +10 -7
  45. package/dist/Table/TableFooter.cjs.map +1 -1
  46. package/dist/Table/TableFooter.js +10 -7
  47. package/dist/Table/TableFooter.js.map +1 -1
  48. package/dist/Tabs/TabLink.cjs +2 -2
  49. package/dist/Tabs/TabLink.cjs.map +1 -1
  50. package/dist/Tabs/TabLink.d.ts +1 -1
  51. package/dist/Tabs/TabLink.js +2 -2
  52. package/dist/Tabs/TabLink.js.map +1 -1
  53. package/dist/Tabs/VerticalTabs.cjs +2 -2
  54. package/dist/Tabs/VerticalTabs.cjs.map +1 -1
  55. package/dist/Tabs/VerticalTabs.d.ts +1 -1
  56. package/dist/Tabs/VerticalTabs.js +2 -2
  57. package/dist/Tabs/VerticalTabs.js.map +1 -1
  58. package/dist/hooks/useClickOutside.cjs +39 -0
  59. package/dist/hooks/useClickOutside.cjs.map +1 -0
  60. package/dist/hooks/useClickOutside.d.ts +5 -0
  61. package/dist/hooks/useClickOutside.js +26 -0
  62. package/dist/hooks/useClickOutside.js.map +1 -0
  63. package/package.json +1 -1
  64. package/dist/common/NavigationHelper.cjs.map +0 -1
  65. package/dist/common/NavigationHelper.js.map +0 -1
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = exports.MobileMenuHeaderWrapper = exports.MobileMenuHeaderActions = void 0;
9
9
 
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
-
12
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
11
 
14
12
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
@@ -31,10 +29,6 @@ var _ProfileButton = require("../../ProfileButton");
31
29
 
32
30
  var _jsxRuntime = require("react/jsx-runtime");
33
31
 
34
- var _excluded = ["placement", "type", "action"],
35
- _excluded2 = ["placement", "type", "icon", "menu"],
36
- _excluded3 = ["placement", "type", "icon", "action"];
37
-
38
32
  var _templateObject, _templateObject2, _templateObject3;
39
33
 
40
34
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -85,65 +79,42 @@ var MobileMenuHeader = function MobileMenuHeader(_ref) {
85
79
  };
86
80
 
87
81
  var renderItem = function renderItem(item, index) {
82
+ var _profile$user$firstNa, _profile$user, _profile$user$firstNa2, _profile$user$lastNam, _profile$user2, _profile$user2$lastNa;
83
+
88
84
  switch (item.type) {
89
85
  case 'profile':
90
- {
91
- var _profile$user$firstNa, _profile$user, _profile$user$firstNa2, _profile$user$lastNam, _profile$user2, _profile$user2$lastNa;
92
-
93
- var placement = item.placement,
94
- type = item.type,
95
- action = item.action,
96
- rest = (0, _objectWithoutProperties2.default)(item, _excluded);
97
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileButton.ProfileButton, _objectSpread({
98
- onClick: function onClick(e) {
99
- e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
100
- item.action ? item.action(e === null || e === void 0 ? void 0 : e.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu());
101
- },
102
- icon: !profile && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.User, {}),
103
- initials: ((_profile$user$firstNa = profile === null || profile === void 0 ? void 0 : (_profile$user = profile.user) === null || _profile$user === void 0 ? void 0 : (_profile$user$firstNa2 = _profile$user.firstName) === null || _profile$user$firstNa2 === void 0 ? void 0 : _profile$user$firstNa2.charAt(0)) !== null && _profile$user$firstNa !== void 0 ? _profile$user$firstNa : '') + ((_profile$user$lastNam = profile === null || profile === void 0 ? void 0 : (_profile$user2 = profile.user) === null || _profile$user2 === void 0 ? void 0 : (_profile$user2$lastNa = _profile$user2.lastName) === null || _profile$user2$lastNa === void 0 ? void 0 : _profile$user2$lastNa.charAt(0)) !== null && _profile$user$lastNam !== void 0 ? _profile$user$lastNam : '')
104
- }, rest), index);
105
- }
86
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileButton.ProfileButton, {
87
+ onClick: function onClick(e) {
88
+ e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
89
+ item.action ? item.action(e === null || e === void 0 ? void 0 : e.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu());
90
+ },
91
+ icon: !profile && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.User, {}),
92
+ initials: ((_profile$user$firstNa = profile === null || profile === void 0 ? void 0 : (_profile$user = profile.user) === null || _profile$user === void 0 ? void 0 : (_profile$user$firstNa2 = _profile$user.firstName) === null || _profile$user$firstNa2 === void 0 ? void 0 : _profile$user$firstNa2.charAt(0)) !== null && _profile$user$firstNa !== void 0 ? _profile$user$firstNa : '') + ((_profile$user$lastNam = profile === null || profile === void 0 ? void 0 : (_profile$user2 = profile.user) === null || _profile$user2 === void 0 ? void 0 : (_profile$user2$lastNa = _profile$user2.lastName) === null || _profile$user2$lastNa === void 0 ? void 0 : _profile$user2$lastNa.charAt(0)) !== null && _profile$user$lastNam !== void 0 ? _profile$user$lastNam : '')
93
+ }, index);
106
94
 
107
95
  case 'submenu':
108
- {
109
- var _placement = item.placement,
110
- _type = item.type,
111
- icon = item.icon,
112
- menu = item.menu,
113
- _rest = (0, _objectWithoutProperties2.default)(item, _excluded2);
114
-
115
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, _objectSpread(_objectSpread({
116
- variant: 'secondary',
117
- shape: 'circular',
118
- action: function action(e) {
119
- e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
120
- onSubMenuOpen && onSubMenuOpen(item.menu);
121
- }
122
- }, _rest), {}, {
123
- children: item.icon
124
- }), index);
125
- }
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
97
+ disabled: item.disabled,
98
+ variant: 'secondary',
99
+ shape: 'circular',
100
+ action: function action(e) {
101
+ e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
102
+ onSubMenuOpen && onSubMenuOpen(item.menu);
103
+ },
104
+ children: item.icon
105
+ }, index);
126
106
 
127
107
  case 'action':
128
- {
129
- var _placement2 = item.placement,
130
- _type2 = item.type,
131
- _icon = item.icon,
132
- _action = item.action,
133
- _rest2 = (0, _objectWithoutProperties2.default)(item, _excluded3);
134
-
135
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, _objectSpread(_objectSpread({
136
- disabled: item.disabled,
137
- variant: 'secondary',
138
- shape: 'circular',
139
- action: function action(e) {
140
- e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
141
- item.action && item.action(e === null || e === void 0 ? void 0 : e.target) && onClose();
142
- }
143
- }, _rest2), {}, {
144
- children: item.icon
145
- }), index);
146
- }
108
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
109
+ disabled: item.disabled,
110
+ variant: 'secondary',
111
+ shape: 'circular',
112
+ action: function action(e) {
113
+ e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
114
+ item.action && item.action(e === null || e === void 0 ? void 0 : e.target) && onClose();
115
+ },
116
+ children: item.icon
117
+ }, index);
147
118
  }
148
119
  };
149
120
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["MobileMenuHeaderActions","styled","div","MobileMenuHeaderLabel","ComponentTextStyle","Bold","COLORS","neutral_600","BREAKPOINTS","SMALL","MobileMenuHeaderWrapper","Breakpoints","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","placement","rest","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","marginLeft"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEO,IAAMA,uBAAuB,GAAGC,0BAAOC,GAAV,yKAA7B;;;;AAMP,IAAMC,qBAAqB,GAAGF,0BAAOC,GAAV,yHACvB,gCAAmBE,2BAAmBC,IAAtC,EAA4CC,eAAOC,WAAnD,CADuB,EAEvBC,oBAAYC,KAFW,EAGrB,+BAAkBL,2BAAmBC,IAArC,EAA2CC,eAAOC,WAAlD,CAHqB,CAA3B;;AAOO,IAAMG,uBAA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AAK,EAAE,UALnB;AAAA,iCAME,qBAAC,kBAAD,CAAa,KAAb;AANF;AADF,QAPJ;AAAA,MAnBF;AAAA,IADF;AA0CD,CAhHD;;;AAXED,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,K;AAGAE,EAAAA,O;AAEAC,EAAAA,a;;eAuHaN,gB","sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n }\n case 'submenu': {\n const {placement, type, icon, menu, ...rest} = item;\n\n return <IconButton key={index}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.cjs"}
1
+ {"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["MobileMenuHeaderActions","styled","div","MobileMenuHeaderLabel","ComponentTextStyle","Bold","COLORS","neutral_600","BREAKPOINTS","SMALL","MobileMenuHeaderWrapper","Breakpoints","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","placement","marginLeft"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,IAAMA,uBAAuB,GAAGC,0BAAOC,GAAV,yKAA7B;;;;AAMP,IAAMC,qBAAqB,GAAGF,0BAAOC,GAAV,yHACvB,gCAAmBE,2BAAmBC,IAAtC,EAA4CC,eAAOC,WAAnD,CADuB,EAEvBC,oBAAYC,KAFW,EAGrB,+BAAkBL,2BAAmBC,IAArC,EAA2CC,eAAOC,WAAlD,CAHqB,CAA3B;;AAOO,IAAMG,uBAAuB,GAAGT,0BAAOC,GAAV,0PAMhCS,qBAAYF,KANoB,EAUhCE,qBAAYC,MAVoB,CAA7B;;;;AA2BP,IAAMC,gBAAgE,GAAG,SAAnEA,gBAAmE,OAOO;AAAA,MANJC,QAMI,QANJA,QAMI;AAAA,MALJC,OAKI,QALJA,OAKI;AAAA,MAJJC,KAII,QAJJA,KAII;AAAA,MAHJC,OAGI,QAHJA,OAGI;AAAA,MAFJC,OAEI,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,+BACE,qBAAC,kBAAD;AAAY,UAAA,OAAO,EAAE,WAArB;AACY,UAAA,MAAM,EAAE,gBAAAR,CAAC,EAAI;AACXA,YAAAA,CAAC,SAAD,IAAAA,CAAC,WAAD,YAAAA,CAAC,CAAEC,WAAH,CAAeC,wBAAf;AACA5B,YAAAA,OAAO;AACR,WAJb;AAKY,UAAA,KAAK,EAAE,UALnB;AAAA,iCAME,qBAAC,kBAAD,CAAa,KAAb;AANF;AADF,QAPJ;AAAA,MAnBF;AAAA,IADF;AA0CD,CAvGD;;;AAXED,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,K;AAGAE,EAAAA,O;AAEAC,EAAAA,a;;eA8GaN,gB","sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile':\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}/>\n case 'submenu':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}>\n {item.icon}\n </IconButton>\n case 'action':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}>\n {item.icon}\n </IconButton>\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.cjs"}
@@ -1,10 +1,6 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
4
3
  import _pt from "prop-types";
5
- var _excluded = ["placement", "type", "action"],
6
- _excluded2 = ["placement", "type", "icon", "menu"],
7
- _excluded3 = ["placement", "type", "icon", "action"];
8
4
 
9
5
  var _templateObject, _templateObject2, _templateObject3;
10
6
 
@@ -59,66 +55,42 @@ var MobileMenuHeader = function MobileMenuHeader(_ref) {
59
55
  };
60
56
 
61
57
  var renderItem = function renderItem(item, index) {
58
+ var _profile$user$firstNa, _profile$user, _profile$user$firstNa2, _profile$user$lastNam, _profile$user2, _profile$user2$lastNa;
59
+
62
60
  switch (item.type) {
63
61
  case 'profile':
64
- {
65
- var _profile$user$firstNa, _profile$user, _profile$user$firstNa2, _profile$user$lastNam, _profile$user2, _profile$user2$lastNa;
66
-
67
- var placement = item.placement,
68
- type = item.type,
69
- action = item.action,
70
- rest = _objectWithoutProperties(item, _excluded);
71
-
72
- return /*#__PURE__*/_jsx(ProfileButton, _objectSpread({
73
- onClick: function onClick(e) {
74
- e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
75
- item.action ? item.action(e === null || e === void 0 ? void 0 : e.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu());
76
- },
77
- icon: !profile && /*#__PURE__*/_jsx(SystemIcons.User, {}),
78
- initials: ((_profile$user$firstNa = profile === null || profile === void 0 ? void 0 : (_profile$user = profile.user) === null || _profile$user === void 0 ? void 0 : (_profile$user$firstNa2 = _profile$user.firstName) === null || _profile$user$firstNa2 === void 0 ? void 0 : _profile$user$firstNa2.charAt(0)) !== null && _profile$user$firstNa !== void 0 ? _profile$user$firstNa : '') + ((_profile$user$lastNam = profile === null || profile === void 0 ? void 0 : (_profile$user2 = profile.user) === null || _profile$user2 === void 0 ? void 0 : (_profile$user2$lastNa = _profile$user2.lastName) === null || _profile$user2$lastNa === void 0 ? void 0 : _profile$user2$lastNa.charAt(0)) !== null && _profile$user$lastNam !== void 0 ? _profile$user$lastNam : '')
79
- }, rest), index);
80
- }
62
+ return /*#__PURE__*/_jsx(ProfileButton, {
63
+ onClick: function onClick(e) {
64
+ e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
65
+ item.action ? item.action(e === null || e === void 0 ? void 0 : e.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu());
66
+ },
67
+ icon: !profile && /*#__PURE__*/_jsx(SystemIcons.User, {}),
68
+ initials: ((_profile$user$firstNa = profile === null || profile === void 0 ? void 0 : (_profile$user = profile.user) === null || _profile$user === void 0 ? void 0 : (_profile$user$firstNa2 = _profile$user.firstName) === null || _profile$user$firstNa2 === void 0 ? void 0 : _profile$user$firstNa2.charAt(0)) !== null && _profile$user$firstNa !== void 0 ? _profile$user$firstNa : '') + ((_profile$user$lastNam = profile === null || profile === void 0 ? void 0 : (_profile$user2 = profile.user) === null || _profile$user2 === void 0 ? void 0 : (_profile$user2$lastNa = _profile$user2.lastName) === null || _profile$user2$lastNa === void 0 ? void 0 : _profile$user2$lastNa.charAt(0)) !== null && _profile$user$lastNam !== void 0 ? _profile$user$lastNam : '')
69
+ }, index);
81
70
 
82
71
  case 'submenu':
83
- {
84
- var _placement = item.placement,
85
- _type = item.type,
86
- icon = item.icon,
87
- menu = item.menu,
88
- _rest = _objectWithoutProperties(item, _excluded2);
89
-
90
- return /*#__PURE__*/_jsx(IconButton, _objectSpread(_objectSpread({
91
- variant: 'secondary',
92
- shape: 'circular',
93
- action: function action(e) {
94
- e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
95
- onSubMenuOpen && onSubMenuOpen(item.menu);
96
- }
97
- }, _rest), {}, {
98
- children: item.icon
99
- }), index);
100
- }
72
+ return /*#__PURE__*/_jsx(IconButton, {
73
+ disabled: item.disabled,
74
+ variant: 'secondary',
75
+ shape: 'circular',
76
+ action: function action(e) {
77
+ e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
78
+ onSubMenuOpen && onSubMenuOpen(item.menu);
79
+ },
80
+ children: item.icon
81
+ }, index);
101
82
 
102
83
  case 'action':
103
- {
104
- var _placement2 = item.placement,
105
- _type2 = item.type,
106
- _icon = item.icon,
107
- _action = item.action,
108
- _rest2 = _objectWithoutProperties(item, _excluded3);
109
-
110
- return /*#__PURE__*/_jsx(IconButton, _objectSpread(_objectSpread({
111
- disabled: item.disabled,
112
- variant: 'secondary',
113
- shape: 'circular',
114
- action: function action(e) {
115
- e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
116
- item.action && item.action(e === null || e === void 0 ? void 0 : e.target) && onClose();
117
- }
118
- }, _rest2), {}, {
119
- children: item.icon
120
- }), index);
121
- }
84
+ return /*#__PURE__*/_jsx(IconButton, {
85
+ disabled: item.disabled,
86
+ variant: 'secondary',
87
+ shape: 'circular',
88
+ action: function action(e) {
89
+ e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
90
+ item.action && item.action(e === null || e === void 0 ? void 0 : e.target) && onClose();
91
+ },
92
+ children: item.icon
93
+ }, index);
122
94
  }
123
95
  };
124
96
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["React","styled","Breakpoints","IconButton","SystemIcons","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ProfileButton","MobileMenuHeaderActions","div","MobileMenuHeaderLabel","Bold","neutral_600","SMALL","MobileMenuHeaderWrapper","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","placement","rest","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","marginLeft"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAMA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,WAAP,MAAwB,0BAAxB;AACA,SAAQC,UAAR,QAAyB,cAAzB;AACA,SAAQC,WAAR,QAA0B,aAA1B;AACA,SAAQC,WAAR,EAAqBC,MAArB,EAA6BC,iBAA7B,EAAgDC,kBAAhD,EAAoEC,kBAApE,QAA6F,cAA7F;AACA,SAAQC,aAAR,QAA4B,qBAA5B;;;AAEA,OAAO,IAAMC,uBAAuB,GAAGV,MAAM,CAACW,GAAV,2JAA7B;AAMP,IAAMC,qBAAqB,GAAGZ,MAAM,CAACW,GAAV,2GACvBH,kBAAkB,CAACD,kBAAkB,CAACM,IAApB,EAA0BR,MAAM,CAACS,WAAjC,CADK,EAEvBV,WAAW,CAACW,KAFW,EAGrBT,iBAAiB,CAACC,kBAAkB,CAACM,IAApB,EAA0BR,MAAM,CAACS,WAAjC,CAHI,CAA3B;AAOA,OAAO,IAAME,uBAAuB,GAAGhB,MAAM,CAACW,GAAV,4OAMhCV,WAAW,CAACc,KANoB,EAUhCd,WAAW,CAACgB,MAVoB,CAA7B;;AA2BP,IAAMC,gBAAgE,GAAG,SAAnEA,gBAAmE,OAOO;AAAA,MANJC,QAMI,QANJA,QAMI;AAAA,MALJC,OAKI,QALJA,OAKI;AAAA,MAJJC,KAII,Q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nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n }\n case 'submenu': {\n const {placement, type, icon, menu, ...rest} = item;\n\n return <IconButton key={index}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.js"}
1
+ {"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["React","styled","Breakpoints","IconButton","SystemIcons","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ProfileButton","MobileMenuHeaderActions","div","MobileMenuHeaderLabel","Bold","neutral_600","SMALL","MobileMenuHeaderWrapper","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","placement","marginLeft"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAMA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,WAAP,MAAwB,0BAAxB;AACA,SAAQC,UAAR,QAAyB,cAAzB;AACA,SAAQC,WAAR,QAA0B,aAA1B;AACA,SAAQC,WAAR,EAAqBC,MAArB,EAA6BC,iBAA7B,EAAgDC,kBAAhD,EAAoEC,kBAApE,QAA6F,cAA7F;AACA,SAAQC,aAAR,QAA4B,qBAA5B;;;AAEA,OAAO,IAAMC,uBAAuB,GAAGV,MAAM,CAACW,GAAV,2JAA7B;AAMP,IAAMC,qBAAqB,GAAGZ,MAAM,CAACW,GAAV,2GACvBH,kBAAkB,CAACD,kBAAkB,CAACM,IAApB,EAA0BR,MAAM,CAACS,WAAjC,CADK,EAEvBV,WAAW,CAACW,KAFW,EAGrBT,iBAAiB,CAACC,kBAAkB,CAACM,IAApB,EAA0BR,MAAM,CAACS,WAAjC,CAHI,CAA3B;AAOA,OAAO,IAAME,uBAAuB,GAAGhB,MAAM,CAACW,GAAV,4OAMhCV,WAAW,CAACc,KANoB,EAUhCd,WAAW,CAACgB,MAVoB,CAA7B;;AA2BP,IAAMC,gBAAgE,GAAG,SAAnEA,gBAAmE,OAOO;AAAA,MANJC,QAMI,QANJA,QAM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CAFJ,EAMIvB,OAAO,iBACP;AAAK,QAAA,KAAK,EAAE;AAACkC,UAAAA,UAAU,EAAE;AAAb,SAAZ;AAAA,+BACE,KAAC,UAAD;AAAY,UAAA,OAAO,EAAE,WAArB;AACY,UAAA,MAAM,EAAE,gBAAAR,CAAC,EAAI;AACXA,YAAAA,CAAC,SAAD,IAAAA,CAAC,WAAD,YAAAA,CAAC,CAAEC,WAAH,CAAeC,wBAAf;AACA5B,YAAAA,OAAO;AACR,WAJb;AAKY,UAAA,KAAK,EAAE,UALnB;AAAA,iCAME,KAAC,WAAD,CAAa,KAAb;AANF;AADF,QAPJ;AAAA,MAnBF;AAAA,IADF;AA0CD,CAvGD;;;AAXED,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,K;AAGAE,EAAAA,O;AAEAC,EAAAA,a;;AA8GF,eAAeN,gBAAf","sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile':\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}/>\n case 'submenu':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}>\n {item.icon}\n </IconButton>\n case 'action':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}>\n {item.icon}\n </IconButton>\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.js"}
@@ -1,8 +1,5 @@
1
1
  import React from 'react';
2
2
  import { HyperlinkProps } from '../HyperLink/HyperLink';
3
- import { IconButtonProps } from '../Button/Iconbutton';
4
- import { ProfileButtonProps } from '../ProfileButton/ProfileButton';
5
- import { NavLinkProps } from 'react-router-dom';
6
3
  export interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {
7
4
  label: string;
8
5
  icon?: React.ReactElement;
@@ -35,26 +32,30 @@ export interface ProfileMenu {
35
32
  sections: MenuNavigationSection[];
36
33
  signOut?: MenuButton;
37
34
  }
38
- export interface MenuIconSubMenuButton extends Omit<IconButtonProps, 'type' | 'action' | 'shape' | 'variant' | 'hideOnLowWidth' | 'flatEdge' | 'isInMobileMenu' | 'useTransparentBackground' | 'shouldNotInteract' | 'iconColor' | 'unsetIconSize' | 'borderRadius' | 'focusBackgroundColor' | 'children' | 'invertFocus'> {
35
+ export interface MenuIconSubMenuButton {
39
36
  type: 'submenu';
40
37
  icon: React.ReactNode;
41
38
  menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;
42
39
  placement?: 'left' | 'right';
40
+ disabled?: boolean;
43
41
  }
44
- export interface MenuIconButton extends Omit<IconButtonProps, 'type' | 'action' | 'shape' | 'variant' | 'hideOnLowWidth' | 'flatEdge' | 'isInMobileMenu' | 'useTransparentBackground' | 'shouldNotInteract' | 'iconColor' | 'unsetIconSize' | 'borderRadius' | 'focusBackgroundColor' | 'children' | 'invertFocus'> {
42
+ export interface MenuIconButton {
45
43
  type: 'action';
46
44
  icon: React.ReactNode;
47
45
  action: (button?: EventTarget) => boolean | void;
48
46
  placement?: 'left' | 'right';
47
+ disabled?: boolean;
49
48
  }
50
- export interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {
49
+ export interface MenuProfileButton {
51
50
  type: 'profile';
52
51
  action?: (button?: EventTarget) => boolean | void;
53
52
  placement?: 'left' | 'right';
53
+ disabled?: boolean;
54
54
  }
55
- export interface MenuSwitcherButton extends Omit<IconButtonProps, 'id' | 'type' | 'action' | 'shape' | 'variant' | 'hideOnLowWidth' | 'flatEdge' | 'isInMobileMenu' | 'useTransparentBackground' | 'shouldNotInteract' | 'iconColor' | 'unsetIconSize' | 'borderRadius' | 'focusBackgroundColor' | 'children' | 'invertFocus'> {
55
+ export interface MenuSwitcherButton {
56
56
  type: 'switcher';
57
57
  placement?: 'left' | 'right';
58
+ disabled?: boolean;
58
59
  action?: (button?: EventTarget) => boolean | void;
59
60
  }
60
61
  export declare type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;
@@ -88,11 +89,11 @@ export declare type MenuNavigationItem = {
88
89
  exact?: boolean;
89
90
  disabled?: boolean;
90
91
  external?: boolean;
91
- action?: (e: React.MouseEvent) => void;
92
+ action?: () => void;
92
93
  label: string;
93
94
  note?: string;
94
95
  pinned?: boolean;
95
- } & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;
96
+ };
96
97
  export interface MenuNavigationSection<T = MenuNavigationItem> {
97
98
  divider?: boolean;
98
99
  pinned?: boolean;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["PortraitOverlay","styled","div","COLORS","black","ProfileButtonContainer","StyledPrimaryIconButton","props","hideOnLowWidth","BREAKPOINTS","MEDIUM","IconButtonContent","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","React","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","rest","renderIcon","ComponentTextStyle","Bold","white","Size","Medium"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;AAWA,IAAMA,eAAe,GAAGC,0BAAOC,GAAV,0OAICC,SAAOC,KAJR,CAArB;;AAWO,IAAMC,sBAAsB,GAAGJ,0BAAOC,GAAV,8vBAM/BI,mCAN+B,EAOpB,UAAAC,KAAK;AAAA,SAAKA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,QAArC;AAAA,CAPe,EAS7BC,oBAAYC,MATiB,EAkB3BC,6BAlB2B,EAmBPR,SAAOS,WAnBA,EAsBjBT,SAAOU,WAtBU,EA6B3Bb,eA7B2B,EAqC3BA,eArC2B,CAA5B;;;;AA6CP,IAAMc,qBAAqB,GAAGb,0BAAOC,GAAV,8IAA3B;;AAMA,IAAMa,YAAY,GAAGd,0BAAOC,GAAV,qPAAlB;;AAaA,IAAMc,aAAa,gBAAGC,KAAK,CAACC,UAAN,CAAwD,gBAWIC,GAXJ,EAWY;AAAA,MAVTC,WAUS,QAVTA,WAUS;AAAA,MATTC,IASS,QATTA,IASS;AAAA,MARTC,QAQS,QARTA,QAQS;AAAA,MAPTC,OAOS,QAPTA,OAOS;AAAA,MANTf,cAMS,QANTA,cAMS;AAAA,MALTgB,QAKS,QALTA,QAKS;AAAA,MAJTC,mBAIS,QAJTA,mBAIS;AAAA,MAHTC,SAGS,QAHTA,SAGS;AAAA,MAFTC,QAES,QAFTA,QAES;AAAA,MADNC,IACM;;AACxF,MAAMC,UAAU,GAAG,SAAbA,UAAa,GAAM;AACvB,WACGT,WAAW,iBACV,sBAAC,YAAD;AAAA,8BACE;AAAK,QAAA,GAAG,EAAEA;AAAV,QADF,eAEE,qBAAC,eAAD,KAFF;AAAA,MADF,IAMCE,QAAQ,iBACP,qBAAC,kBAAD;AAAY,MAAA,SAAS,EAAC,UAAtB;AAAiC,MAAA,SAAS,EAAEQ,2BAAmBC,IAA/D;AACY,MAAA,KAAK,EAAEP,QAAQ,GAAGrB,SAAOU,WAAV,GAAwBV,SAAO6B,KAD1D;AAAA,gBAEGV;AAFH,MAPF,iBAWM;AAAA,gBAAGD;AAAH,MAZR;AAcD,GAfD;;AAiBA,sBACE,qBAAC,sBAAD;AAAwB,IAAA,cAAc,EAAEb,cAAxC;AAAA,2BACE,sBAAC,YAAD;AAAY,MAAA,GAAG,EAAEW,GAAjB;AACY,MAAA,SAAS,EAAEO,SADvB;AAEY,MAAA,QAAQ,EAAEF,QAFtB;AAGY,MAAA,MAAM,EAAED,OAHpB;AAIY,MAAA,OAAO,EAAC,SAJpB;AAKY,MAAA,QAAQ,EAAEI,QALtB;AAMY,MAAA,KAAK,EAAC,UANlB;AAOY,MAAA,cAAc,EAAEnB;AAP5B,OAQgBoB,IARhB;AAAA,iBASGC,UAAU,EATb,EAUGJ,mBAAmB,iBAClB,qBAAC,qBAAD;AAAA,+BACE,qBAAC,gCAAD;AAAiB,UAAA,IAAI,EAAEQ,OAAKC,MAA5B;AAAoC,UAAA,OAAO,EAAET;AAA7C;AADF,QAXJ;AAAA;AADF,IADF;AAoBD,CAjDqB,CAAtB;;AAnFEL,EAAAA,W;AACAC,EAAAA,I;AACAC,EAAAA,Q;AACAC,EAAAA,O;AACAE,EAAAA,mB,4BAAsB,U,EAAa,U;AACnCjB,EAAAA,c;;eAiIaQ,a","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\nexport type ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n notificationVariant?: 'positive' | 'critical';\n hideOnLowWidth?: boolean;\n} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> ;\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nexport const ProfileButtonContainer = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex,\n ...rest\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <ProfileButtonContainer hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}\n {...rest}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </ProfileButtonContainer>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.cjs"}
1
+ {"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["PortraitOverlay","styled","div","COLORS","black","ProfileButtonContainer","StyledPrimaryIconButton","props","hideOnLowWidth","BREAKPOINTS","MEDIUM","IconButtonContent","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","React","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","rest","renderIcon","ComponentTextStyle","Bold","white","Size","Medium"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;AAWA,IAAMA,eAAe,GAAGC,0BAAOC,GAAV,0OAICC,SAAOC,KAJR,CAArB;;AAWO,IAAMC,sBAAsB,GAAGJ,0BAAOC,GAAV,8vBAM/BI,mCAN+B,EAOpB,UAAAC,KAAK;AAAA,SAAKA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,QAArC;AAAA,CAPe,EAS7BC,oBAAYC,MATiB,EAkB3BC,6BAlB2B,EAmBPR,SAAOS,WAnBA,EAsBjBT,SAAOU,WAtBU,EA6B3Bb,eA7B2B,EAqC3BA,eArC2B,CAA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,cAAc,EAAEnB;AAP5B,OAQgBoB,IARhB;AAAA,iBASGC,UAAU,EATb,EAUGJ,mBAAmB,iBAClB,qBAAC,qBAAD;AAAA,+BACE,qBAAC,gCAAD;AAAiB,UAAA,IAAI,EAAEQ,OAAKC,MAA5B;AAAoC,UAAA,OAAO,EAAET;AAA7C;AADF,QAXJ;AAAA;AADF,IADF;AAoBD,CAjDqB,CAAtB;;AAnFEL,EAAAA,W;AACAC,EAAAA,I;AACAC,EAAAA,Q;AACAC,EAAAA,O;AACAE,EAAAA,mB,4BAAsB,U,EAAa,U;AACnCjB,EAAAA,c;;eAiIaQ,a","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\ntype ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n notificationVariant?: 'positive' | 'critical';\n hideOnLowWidth?: boolean;\n} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> ;\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nexport const ProfileButtonContainer = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex,\n ...rest\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <ProfileButtonContainer hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}\n {...rest}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </ProfileButtonContainer>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.cjs"}
@@ -1,12 +1,4 @@
1
1
  import * as React from 'react';
2
- export declare type ProfileButtonProps = {
3
- portraitSrc?: string;
4
- icon?: React.ReactNode;
5
- initials?: string;
6
- onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;
7
- notificationVariant?: 'positive' | 'critical';
8
- hideOnLowWidth?: boolean;
9
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'>;
10
2
  export declare const ProfileButtonContainer: import("styled-components").StyledComponent<"div", any, {
11
3
  hideOnLowWidth?: boolean | undefined;
12
4
  }, never>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["React","styled","COLORS","IconButton","Size","IconButtonContent","StyledPrimaryIconButton","NotificationDot","BREAKPOINTS","ComponentS","ComponentTextStyle","PortraitOverlay","div","black","ProfileButtonContainer","props","hideOnLowWidth","MEDIUM","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","rest","renderIcon","Bold","white","Medium"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAAQC,MAAR,EAAgBC,UAAhB,EAA4BC,IAA5B,QAAuC,IAAvC;AACA,SAAQC,iBAAR,EAA2BC,uBAA3B,QAAyD,sBAAzD;AACA,SAAQC,eAAR,QAA8B,oBAA9B;AACA,SAAQC,WAAR,EAAqBC,UAArB,EAAiCC,kBAAjC,QAA0D,WAA1D;;;;AAWA,IAAMC,eAAe,GAAGV,MAAM,CAACW,GAAV,4NAICV,MAAM,CAACW,KAJR,CAArB;AAWA,OAAO,IAAMC,sBAAsB,GAAGb,MAAM,CAACW,GAAV,gvBAM/BN,uBAN+B,EAOpB,UAAAS,KAAK;AAAA,SAAKA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,QAArC;AAAA,CAPe,EAS7BR,WAAW,CAACS,MATiB,EAkB3BZ,iBAlB2B,EAmBPH,MAAM,CAACgB,WAnBA,EAsBjBhB,MAAM,CAACiB,WAtBU,EA6B3BR,eA7B2B,EAqC3BA,eArC2B,CAA5B;AA6CP,IAAMS,qBAAqB,GAAGnB,MAAM,CAACW,GAAV,gIA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AAAA,iBASGC,UAAU,EATb,EAUGJ,mBAAmB,iBAClB,KAAC,qBAAD;AAAA,+BACE,KAAC,eAAD;AAAiB,UAAA,IAAI,EAAE1B,IAAI,CAACiC,MAA5B;AAAoC,UAAA,OAAO,EAAEP;AAA7C;AADF,QAXJ;AAAA;AADF,IADF;AAoBD,CAjDqB,CAAtB;;AAnFEL,EAAAA,W;AACAC,EAAAA,I;AACAC,EAAAA,Q;AACAC,EAAAA,O;AACAE,EAAAA,mB,aAAsB,U,EAAa,U;AACnCd,EAAAA,c;;AAiIF,eAAeM,aAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\nexport type ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n notificationVariant?: 'positive' | 'critical';\n hideOnLowWidth?: boolean;\n} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> ;\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nexport const ProfileButtonContainer = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex,\n ...rest\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <ProfileButtonContainer hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}\n {...rest}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </ProfileButtonContainer>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.js"}
1
+ {"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["React","styled","COLORS","IconButton","Size","IconButtonContent","StyledPrimaryIconButton","NotificationDot","BREAKPOINTS","ComponentS","ComponentTextStyle","PortraitOverlay","div","black","ProfileButtonContainer","props","hideOnLowWidth","MEDIUM","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","rest","renderIcon","Bold","white","Medium"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAAQC,MAAR,EAAgBC,UAAhB,EAA4BC,IAA5B,QAAuC,IAAvC;AACA,SAAQC,iBAAR,EAA2BC,uBAA3B,QAAyD,sBAAzD;AACA,SAAQC,eAAR,QAA8B,oBAA9B;AACA,SAAQC,WAAR,EAAqBC,UAArB,EAAiCC,kBAAjC,QAA0D,WAA1D;;;;AAWA,IAAMC,eAAe,GAAGV,MAAM,CAACW,GAAV,4NAICV,MAAM,CAACW,KAJR,CAArB;AAWA,OAAO,IAAMC,sBAAsB,GAAGb,MAAM,CAACW,GAAV,gvBAM/BN,uBAN+B,EAOpB,UAAAS,KAAK;AAAA,SAAKA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,QAArC;AAAA,CAPe,EAS7BR,WAAW,CAACS,MATiB,EAkB3BZ,iBAlB2B,EAmBPH,MAAM,CAACgB,WAnBA,EAsBjBhB,MAAM,CAACiB,WAtBU,EA6B3BR,eA7B2B,EAqC3BA,eArC2B,CAA5B;AA6CP,IAAMS,qBAAqB,GAAGnB,MAAM,CAACW,GAAV,gIAA3B;AAMA,IAAMS,YAAY,GAAGpB,MAAM,CAACW,GAAV,uOAAlB;AAaA,IAAMU,aAAa,gBAAGtB,KAAK,CAACuB,UAAN,CAAwD,gBAWIC,GAXJ,EAWY;AAAA,MAVTC,WAUS,QAVTA,WAUS;AAAA,MATTC,IASS,QATTA,IASS;AAAA,MARTC,QAQS,QARTA,QAQS;AAAA,MAPTC,OAOS,QAPTA,OAOS;AAAA,MANTZ,cAMS,QANTA,cAMS;AAAA,MALTa,QAKS,QALTA,QAKS;AAAA,MAJTC,mBAIS,QAJTA,mBAIS;AAAA,MAHTC,SAGS,QAHTA,SAGS;AA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styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\ntype ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n notificationVariant?: 'positive' | 'critical';\n hideOnLowWidth?: boolean;\n} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> ;\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nexport const ProfileButtonContainer = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex,\n ...rest\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <ProfileButtonContainer hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}\n {...rest}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </ProfileButtonContainer>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.js"}
@@ -30,12 +30,15 @@ var _jsxRuntime = require("react/jsx-runtime");
30
30
  var TableFooter = function TableFooter(props) {
31
31
  var _props$rowsPerPageLab, _props$showMoreLabel, _props$showFewerLabel;
32
32
 
33
- var rowsPerPageOptions = [10, 20, 50, 100];
34
- var rowsPerPageValues = rowsPerPageOptions.map(function (x) {
35
- return {
36
- value: "".concat(x)
37
- };
38
- });
33
+ var rowsPerPageValues = [{
34
+ value: '10'
35
+ }, {
36
+ value: '20'
37
+ }, {
38
+ value: '50'
39
+ }, {
40
+ value: '100'
41
+ }];
39
42
  var dropDownText = "".concat((_props$rowsPerPageLab = props.rowsPerPageLabel) !== null && _props$rowsPerPageLab !== void 0 ? _props$rowsPerPageLab : 'Rows per page', " : ").concat(props.rowsPerPage);
40
43
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TableStyles.StyledTableFooter, {
41
44
  "data-testid": "TestTableFooterRow",
@@ -55,7 +58,7 @@ var TableFooter = function TableFooter(props) {
55
58
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ArrowDropUp, {})]
56
59
  })]
57
60
  }), !props.accordion && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TableStyles.StyledTableFooterContent, {
58
- children: [props.rows && props.rows.length > rowsPerPageOptions[0] && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.DropdownButton, {
61
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.DropdownButton, {
59
62
  type: 'text',
60
63
  items: rowsPerPageValues,
61
64
  disabled: props.showLoadingIndicator,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableFooter.tsx"],"names":["TableFooter","props","rowsPerPageOptions","rowsPerPageValues","map","x","value","dropDownText","rowsPerPageLabel","rowsPerPage","accordion","setIsCollapsed","isCollapsed","defaultOnMouseDownHandler","rows","length","showMoreLabel","showFewerLabel","showLoadingIndicator","onRowsPerPageChange","total","from","to","prevPage","COLORS","neutral_600","nextPage"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;;;AAeA,IAAMA,WAAsD,GAAG,SAAzDA,WAAyD,CAACC,KAAD,EAAW;AAAA;;AACxE,MAAMC,kBAAkB,GAAG,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT,EAAa,GAAb,CAA3B;AACA,MAAMC,iBAAiC,GAAGD,kBAAkB,CAACE,GAAnB,CAAuB,UAAAC,CAAC,EAAI;AAAE,WAAO;AAACC,MAAAA,KAAK,YAAKD,CAAL;AAAN,KAAP;AAAuB,GAArD,CAA1C;AAEA,MAAME,YAAY,sCAAMN,KAAK,CAACO,gBAAZ,yEAAgC,eAAhC,gBAAqDP,KAAK,CAACQ,WAA3D,CAAlB;AAEA,sBACE,sBAAC,8BAAD;AAAmB,mBAAY,oBAA/B;AAAA,eAEQR,KAAK,CAACS,SAAN,iBACA,sBAAC,4CAAD;AAAiC,MAAA,OAAO,EAAE;AAAA,eAAMT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gB,CAAhB,GAAoB,CAApB,GAAwBnB,KAAK,CAACoB,IADjC,OACwCpB,KAAK,CAACqB,EAD9C,UACsDrB,KAAK,CAACmB,KAD5D;AAAA,QAVF,eAaE,sBAAC,sCAAD;AAAA,gCACE,qBAAC,kBAAD;AAAY,UAAA,OAAO,EAAC,WAApB;AAAgC,UAAA,KAAK,EAAC,UAAtC;AAAiD,UAAA,MAAM,EAAE;AAAA,mBAAMnB,KAAK,CAACsB,QAAN,EAAN;AAAA,WAAzD;AACY,UAAA,QAAQ,EAAEtB,KAAK,CAACoB,IAAN,KAAe,CAAf,IAAoBpB,KAAK,CAACiB,oBADhD;AAAA,iCAEE,qBAAC,wBAAD;AAAa,YAAA,IAAI,EAAC,IAAlB;AAAuB,YAAA,KAAK,EAAEM,eAAOC;AAArC;AAFF,UADF,eAKE,qBAAC,kBAAD;AAAY,UAAA,OAAO,EAAC,WAApB;AAAgC,UAAA,KAAK,EAAC,UAAtC;AAAiD,UAAA,MAAM,EAAE;AAAA,mBAAMxB,KAAK,CAACyB,QAAN,EAAN;AAAA,WAAzD;AACY,UAAA,QAAQ,EAAEzB,KAAK,CAACqB,EAAN,KAAarB,KAAK,CAACmB,KAAnB,IAA4BnB,KAAK,CAACiB,oBADxD;AAAA,iCAEE,qBAAC,yBAAD;AAAc,YAAA,IAAI,EAAC,IAAnB;AAAwB,YAAA,KAAK,EAAEM,eAAOC;AAAtC;AAFF,UALF;AAAA,QAbF;AAAA,MAxBR;AAAA,IADF;AAoDD,CA1DD;;;AAXEN,EAAAA,mB;AACAV,EAAAA,W;AACAY,EAAAA,I;AACAC,EAAAA,E;AACAF,EAAAA,K;AACAM,EAAAA,Q;AACAH,EAAAA,Q;AACAZ,EAAAA,c;AACAC,EAAAA,W;;eAgEaZ,W","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownButton, DropdownItem} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\nimport {defaultOnMouseDownHandler} from '../common';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageOptions = [10, 20, 50, 100];\n const rowsPerPageValues: DropdownItem[] = rowsPerPageOptions.map(x => { return {value: `${x}`}});\n\n const dropDownText = `${props.rowsPerPageLabel ?? 'Rows per page'} : ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={defaultOnMouseDownHandler}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>{props.showMoreLabel ?? 'Show more'} ({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>{props.showFewerLabel ?? 'Show fewer'}</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n { props.rows && props.rows.length > rowsPerPageOptions[0] && <DropdownButton\n type={'text'}\n items={rowsPerPageValues}\n disabled={props.showLoadingIndicator}\n value={[`${props.rowsPerPage}`]}\n onClick={(value) => props.onRowsPerPageChange(+value[0])}\n label={dropDownText}\n keepLabel={true}\n />}\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1 || props.showLoadingIndicator}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total || props.showLoadingIndicator}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.cjs"}
1
+ {"version":3,"sources":["../../src/Table/TableFooter.tsx"],"names":["TableFooter","props","rowsPerPageValues","value","dropDownText","rowsPerPageLabel","rowsPerPage","accordion","setIsCollapsed","isCollapsed","defaultOnMouseDownHandler","rows","length","showMoreLabel","showFewerLabel","showLoadingIndicator","onRowsPerPageChange","total","from","to","prevPage","COLORS","neutral_600","nextPage"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;;;AAeA,IAAMA,WAAsD,GAAG,SAAzDA,WAAyD,CAACC,KAAD,EAAW;AAAA;;AACxE,MAAMC,iBAAiC,GAAG,CAAC;AAACC,IAAAA,KAAK,EAAE;AAAR,GAAD,EAAgB;AAACA,IAAAA,KAAK,EAAE;AAAR,GAAhB,EAA+B;AAACA,IAAAA,KAAK,EAAE;AAAR,GAA/B,EAA8C;AAACA,IAAAA,KAAK,EAAE;AAAR,GAA9C,CAA1C;AAEA,MAAMC,YAAY,sCAAMH,KAAK,CAACI,gBAAZ,yEAAgC,eAAhC,gBAAqDJ,KAAK,CAACK,WAA3D,CAAlB;AAEA,sBACE,sBAAC,8BAAD;AAAmB,mBAAY,oBAA/B;AAAA,eAEQL,KAAK,CAACM,SAAN,iBACA,sBAAC,4CAAD;AAAiC,MAAA,OAAO,EAAE;AAAA,eAAMN,KAAK,CAACO,cAAN,CAAqB,C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AC,kBAAD;AAAY,UAAA,OAAO,EAAC,WAApB;AAAgC,UAAA,KAAK,EAAC,UAAtC;AAAiD,UAAA,MAAM,EAAE;AAAA,mBAAMhB,KAAK,CAACmB,QAAN,EAAN;AAAA,WAAzD;AACY,UAAA,QAAQ,EAAEnB,KAAK,CAACiB,IAAN,KAAe,CAAf,IAAoBjB,KAAK,CAACc,oBADhD;AAAA,iCAEE,qBAAC,wBAAD;AAAa,YAAA,IAAI,EAAC,IAAlB;AAAuB,YAAA,KAAK,EAAEM,eAAOC;AAArC;AAFF,UADF,eAKE,qBAAC,kBAAD;AAAY,UAAA,OAAO,EAAC,WAApB;AAAgC,UAAA,KAAK,EAAC,UAAtC;AAAiD,UAAA,MAAM,EAAE;AAAA,mBAAMrB,KAAK,CAACsB,QAAN,EAAN;AAAA,WAAzD;AACY,UAAA,QAAQ,EAAEtB,KAAK,CAACkB,EAAN,KAAalB,KAAK,CAACgB,KAAnB,IAA4BhB,KAAK,CAACc,oBADxD;AAAA,iCAEE,qBAAC,yBAAD;AAAc,YAAA,IAAI,EAAC,IAAnB;AAAwB,YAAA,KAAK,EAAEM,eAAOC;AAAtC;AAFF,UALF;AAAA,QAbF;AAAA,MAxBR;AAAA,IADF;AAoDD,CAzDD;;;AAXEN,EAAAA,mB;AACAV,EAAAA,W;AACAY,EAAAA,I;AACAC,EAAAA,E;AACAF,EAAAA,K;AACAM,EAAAA,Q;AACAH,EAAAA,Q;AACAZ,EAAAA,c;AACAC,EAAAA,W;;eA+DaT,W","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownButton, DropdownItem} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\nimport {defaultOnMouseDownHandler} from '../common';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownItem[] = [{value: '10'}, {value: '20'}, {value: '50'}, {value: '100'}];\n\n const dropDownText = `${props.rowsPerPageLabel ?? 'Rows per page'} : ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={defaultOnMouseDownHandler}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>{props.showMoreLabel ?? 'Show more'} ({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>{props.showFewerLabel ?? 'Show fewer'}</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownButton\n type={'text'}\n items={rowsPerPageValues}\n disabled={props.showLoadingIndicator}\n value={[`${props.rowsPerPage}`]}\n onClick={(value) => props.onRowsPerPageChange(+value[0])}\n label={dropDownText}\n keepLabel={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1 || props.showLoadingIndicator}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total || props.showLoadingIndicator}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.cjs"}
@@ -14,12 +14,15 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
14
14
  var TableFooter = function TableFooter(props) {
15
15
  var _props$rowsPerPageLab, _props$showMoreLabel, _props$showFewerLabel;
16
16
 
17
- var rowsPerPageOptions = [10, 20, 50, 100];
18
- var rowsPerPageValues = rowsPerPageOptions.map(function (x) {
19
- return {
20
- value: "".concat(x)
21
- };
22
- });
17
+ var rowsPerPageValues = [{
18
+ value: '10'
19
+ }, {
20
+ value: '20'
21
+ }, {
22
+ value: '50'
23
+ }, {
24
+ value: '100'
25
+ }];
23
26
  var dropDownText = "".concat((_props$rowsPerPageLab = props.rowsPerPageLabel) !== null && _props$rowsPerPageLab !== void 0 ? _props$rowsPerPageLab : 'Rows per page', " : ").concat(props.rowsPerPage);
24
27
  return /*#__PURE__*/_jsxs(StyledTableFooter, {
25
28
  "data-testid": "TestTableFooterRow",
@@ -39,7 +42,7 @@ var TableFooter = function TableFooter(props) {
39
42
  }), /*#__PURE__*/_jsx(SystemIcons.ArrowDropUp, {})]
40
43
  })]
41
44
  }), !props.accordion && /*#__PURE__*/_jsxs(StyledTableFooterContent, {
42
- children: [props.rows && props.rows.length > rowsPerPageOptions[0] && /*#__PURE__*/_jsx(DropdownButton, {
45
+ children: [/*#__PURE__*/_jsx(DropdownButton, {
43
46
  type: 'text',
44
47
  items: rowsPerPageValues,
45
48
  disabled: props.showLoadingIndicator,