@bigbinary/neeto-molecules 4.0.60 → 4.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/NavigationHeader.js
CHANGED
|
@@ -11,8 +11,9 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
11
11
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
12
|
import classnames from 'classnames';
|
|
13
13
|
import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
14
|
-
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
15
14
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
15
|
+
import MoreDropdown from './MoreDropdown.js';
|
|
16
|
+
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
16
17
|
import { useTranslation } from 'react-i18next';
|
|
17
18
|
import { createElement } from 'react';
|
|
18
19
|
import PublishBlock from './PublishBlock.js';
|
|
@@ -28,7 +29,6 @@ import '@bigbinary/neetoui/Button';
|
|
|
28
29
|
import '@bigbinary/neetoui/Input';
|
|
29
30
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
30
31
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
31
|
-
import './MoreDropdown.js';
|
|
32
32
|
import '@bigbinary/neeto-icons/MenuHorizontal';
|
|
33
33
|
import '@bigbinary/neeto-icons/MenuVertical';
|
|
34
34
|
import '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
@@ -51,8 +51,8 @@ var DEFAULT_HOME_BUTTON_PROPS = {
|
|
|
51
51
|
icon: /*#__PURE__*/jsx(Home, {})
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
function ownKeys$
|
|
55
|
-
function _objectSpread$
|
|
54
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
55
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
56
56
|
var LeftBlock = function LeftBlock(_ref) {
|
|
57
57
|
var customHomeButtonProps = _ref.homeButtonProps,
|
|
58
58
|
homeUrl = _ref.homeUrl,
|
|
@@ -76,88 +76,128 @@ var LeftBlock = function LeftBlock(_ref) {
|
|
|
76
76
|
children: homeButtonProps.icon
|
|
77
77
|
})
|
|
78
78
|
})
|
|
79
|
-
}), isPresent(renameProps) && /*#__PURE__*/jsx(Rename, _objectSpread$
|
|
79
|
+
}), isPresent(renameProps) && /*#__PURE__*/jsx(Rename, _objectSpread$3({
|
|
80
80
|
dropdownItems: renameProps.dropdownItems,
|
|
81
81
|
value: renameProps.value
|
|
82
82
|
}, renameProps)), children]
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
var _excluded = ["key", "label", "disabled"],
|
|
87
|
-
_excluded2 = ["key", "
|
|
88
|
-
function ownKeys$
|
|
89
|
-
function _objectSpread$
|
|
86
|
+
var _excluded$1 = ["key", "to", "label", "disabled"],
|
|
87
|
+
_excluded2 = ["key", "label"];
|
|
88
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
89
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
90
90
|
var Menu = Dropdown.Menu,
|
|
91
91
|
MenuItem = Dropdown.MenuItem;
|
|
92
|
+
var OverflowLinks = function OverflowLinks(_ref) {
|
|
93
|
+
var overflowLinks = _ref.overflowLinks;
|
|
94
|
+
var _useLocation = useLocation(),
|
|
95
|
+
pathname = _useLocation.pathname;
|
|
96
|
+
var _useTranslation = useTranslation(),
|
|
97
|
+
t = _useTranslation.t;
|
|
98
|
+
var isMoreButtonActive = existsBy({
|
|
99
|
+
to: pathname
|
|
100
|
+
}, overflowLinks);
|
|
101
|
+
if (!isNotEmpty(overflowLinks)) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return /*#__PURE__*/jsx(Dropdown, {
|
|
105
|
+
buttonStyle: "text",
|
|
106
|
+
label: t("neetoMolecules.navigationHeader.more"),
|
|
107
|
+
position: "bottom-end",
|
|
108
|
+
buttonProps: {
|
|
109
|
+
className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
|
|
110
|
+
active: isMoreButtonActive
|
|
111
|
+
})
|
|
112
|
+
},
|
|
113
|
+
children: /*#__PURE__*/jsx(Menu, {
|
|
114
|
+
children: overflowLinks.map(function (_ref2) {
|
|
115
|
+
var key = _ref2.key,
|
|
116
|
+
to = _ref2.to,
|
|
117
|
+
label = _ref2.label,
|
|
118
|
+
disabled = _ref2.disabled,
|
|
119
|
+
rest = _objectWithoutProperties(_ref2, _excluded$1);
|
|
120
|
+
var isActive = to === pathname;
|
|
121
|
+
var menuButton = /*#__PURE__*/createElement(MenuItem.Button, _objectSpread$2({
|
|
122
|
+
isActive: isActive,
|
|
123
|
+
to: to,
|
|
124
|
+
"data-cy": "".concat(joinHyphenCase(key), "-more-tab"),
|
|
125
|
+
isDisabled: disabled,
|
|
126
|
+
key: key,
|
|
127
|
+
onClick: function onClick(e) {
|
|
128
|
+
return disabled && e.preventDefault();
|
|
129
|
+
}
|
|
130
|
+
}, rest), label);
|
|
131
|
+
if (isActive && rest.moreOptions && isNotEmpty(rest.moreOptions.menuItems)) {
|
|
132
|
+
return /*#__PURE__*/jsx(Dropdown, {
|
|
133
|
+
customTarget: menuButton,
|
|
134
|
+
position: "right-start",
|
|
135
|
+
trigger: "hover",
|
|
136
|
+
children: /*#__PURE__*/jsx(Menu, {
|
|
137
|
+
children: rest.moreOptions.menuItems.map(function (_ref3) {
|
|
138
|
+
var key = _ref3.key,
|
|
139
|
+
label = _ref3.label,
|
|
140
|
+
itemProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
141
|
+
return /*#__PURE__*/jsx(MenuItem.Button, _objectSpread$2(_objectSpread$2({}, itemProps), {}, {
|
|
142
|
+
children: label
|
|
143
|
+
}), key);
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
}, "".concat(key, "-nested-dropdown"));
|
|
147
|
+
}
|
|
148
|
+
return menuButton;
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var _excluded = ["className", "key", "label", "disabled", "labelProps", "moreOptions"];
|
|
155
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
156
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
92
157
|
var NavigationLinks = function NavigationLinks(_ref) {
|
|
93
158
|
var headerLinks = _ref.headerLinks,
|
|
94
159
|
_ref$maxVisibleLinks = _ref.maxVisibleLinks,
|
|
95
160
|
maxVisibleLinks = _ref$maxVisibleLinks === void 0 ? 5 : _ref$maxVisibleLinks;
|
|
96
161
|
var _useLocation = useLocation(),
|
|
97
162
|
pathname = _useLocation.pathname;
|
|
98
|
-
var _useTranslation = useTranslation(),
|
|
99
|
-
t = _useTranslation.t;
|
|
100
163
|
var visibleLinks = headerLinks.slice(0, maxVisibleLinks);
|
|
101
164
|
var overflowLinks = headerLinks.slice(maxVisibleLinks);
|
|
102
|
-
var isMoreButtonActive = existsBy({
|
|
103
|
-
to: pathname
|
|
104
|
-
}, overflowLinks);
|
|
105
165
|
return /*#__PURE__*/jsxs("div", {
|
|
106
166
|
className: "font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6",
|
|
107
167
|
"data-cy": "navigation-header-navigation-links",
|
|
108
168
|
"data-testid": "navigation-header-navigation-links",
|
|
109
169
|
children: [visibleLinks.map(function (_ref2) {
|
|
110
|
-
var
|
|
170
|
+
var _rest$isActive;
|
|
171
|
+
var _ref2$className = _ref2.className,
|
|
172
|
+
className = _ref2$className === void 0 ? "" : _ref2$className,
|
|
173
|
+
key = _ref2.key,
|
|
111
174
|
label = _ref2.label,
|
|
112
175
|
disabled = _ref2.disabled,
|
|
176
|
+
labelProps = _ref2.labelProps,
|
|
177
|
+
moreOptions = _ref2.moreOptions,
|
|
113
178
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
114
|
-
return /*#__PURE__*/
|
|
179
|
+
return /*#__PURE__*/jsxs(NavLink, _objectSpread$1(_objectSpread$1({
|
|
115
180
|
activeClassName: "active",
|
|
116
181
|
"data-cy": "".concat(joinHyphenCase(key), "-tab"),
|
|
117
182
|
"data-testid": "".concat(joinHyphenCase(key), "-tab"),
|
|
118
|
-
className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", {
|
|
183
|
+
className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", className, {
|
|
119
184
|
disabled: disabled
|
|
120
185
|
}),
|
|
121
186
|
onClick: function onClick(e) {
|
|
122
187
|
return disabled && e.preventDefault();
|
|
123
188
|
}
|
|
124
189
|
}, rest), {}, {
|
|
125
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
190
|
+
children: [/*#__PURE__*/jsx(Typography, _objectSpread$1(_objectSpread$1({
|
|
126
191
|
component: "span",
|
|
127
192
|
lineHeight: "normal",
|
|
128
193
|
style: "h4",
|
|
129
|
-
weight: "semibold"
|
|
194
|
+
weight: "semibold"
|
|
195
|
+
}, labelProps || {}), {}, {
|
|
130
196
|
children: label
|
|
131
|
-
})
|
|
197
|
+
})), (((_rest$isActive = rest.isActive) === null || _rest$isActive === void 0 ? void 0 : _rest$isActive.call(rest)) || rest.to === pathname) && moreOptions && /*#__PURE__*/jsx(MoreDropdown, _objectSpread$1({}, moreOptions))]
|
|
132
198
|
}), key);
|
|
133
|
-
}),
|
|
134
|
-
|
|
135
|
-
label: t("neetoMolecules.navigationHeader.more"),
|
|
136
|
-
position: "bottom-end",
|
|
137
|
-
buttonProps: {
|
|
138
|
-
className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
|
|
139
|
-
active: isMoreButtonActive
|
|
140
|
-
})
|
|
141
|
-
},
|
|
142
|
-
children: /*#__PURE__*/jsx(Menu, {
|
|
143
|
-
children: overflowLinks.map(function (_ref3) {
|
|
144
|
-
var key = _ref3.key,
|
|
145
|
-
to = _ref3.to,
|
|
146
|
-
label = _ref3.label,
|
|
147
|
-
disabled = _ref3.disabled,
|
|
148
|
-
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
149
|
-
return /*#__PURE__*/createElement(MenuItem.Button, _objectSpread$1({
|
|
150
|
-
to: to,
|
|
151
|
-
"data-cy": "".concat(joinHyphenCase(key), "-more-tab"),
|
|
152
|
-
isActive: to === pathname,
|
|
153
|
-
isDisabled: disabled,
|
|
154
|
-
key: key,
|
|
155
|
-
onClick: function onClick(e) {
|
|
156
|
-
return disabled && e.preventDefault();
|
|
157
|
-
}
|
|
158
|
-
}, rest), label);
|
|
159
|
-
})
|
|
160
|
-
})
|
|
199
|
+
}), /*#__PURE__*/jsx(OverflowLinks, {
|
|
200
|
+
overflowLinks: overflowLinks
|
|
161
201
|
})]
|
|
162
202
|
});
|
|
163
203
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationHeader.js","sources":["../src/components/NavigationHeader/constants.jsx","../src/components/NavigationHeader/LeftBlock.jsx","../src/components/NavigationHeader/Navigation.jsx","../src/components/NavigationHeader/utils.js","../src/components/NavigationHeader/RightBlock.jsx","../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(({ key, label, disabled, ...rest }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n </NavLink>\n ))}\n {isNotEmpty(overflowLinks) && (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => (\n <MenuItem.Button\n {...{ to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isActive={to === pathname}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n ))}\n </Menu>\n </Dropdown>\n )}\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","visibleLinks","slice","overflowLinks","isMoreButtonActive","existsBy","map","_ref2","key","label","disabled","rest","_objectWithoutProperties","_excluded","NavLink","activeClassName","concat","joinHyphenCase","classNames","onClick","e","preventDefault","Typography","component","lineHeight","style","weight","isNotEmpty","buttonStyle","buttonProps","active","_ref3","_excluded2","_createElement","Button","isActive","isDisabled","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,CAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,GAAA,CAACC,IAAI,EAAA,EAAE;AACf,CAAC;;;;ACAD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJaC,qBAAqB,GAAAD,IAAA,CAAtCE,eAAe;IACfP,OAAO,GAAAK,IAAA,CAAPL,OAAO;IACPQ,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,QAAQ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EAAE8D,SAAU;QAAA/G,QAAA,EAAA,CACjDqG,eAAe,EACf,CAACM,QAAQ,IAAIL,eAAe,EAC5BC,gBAAgB;OACd;AAAC,KACH,CAAC,EACLI,QAAQ,iBACPlH,GAAA,CAAA,KAAA,EAAA;AAAKU,MAAAA,SAAS,EAAC,yJAAyJ;AAAAH,MAAAA,QAAA,EACrKsG;AAAe,KACb,CACN;AAAA,GACE,CAAC;AAEV;AAEAF,gBAAgB,CAACa,eAAe,GAAGtH,SAAS;AAC5CyG,gBAAgB,CAACpF,eAAe,GAAGA,eAAe;AAClDoF,gBAAgB,CAACc,gBAAgB,GAAGlD,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"NavigationHeader.js","sources":["../src/components/NavigationHeader/constants.jsx","../src/components/NavigationHeader/LeftBlock.jsx","../src/components/NavigationHeader/OverflowLinks.jsx","../src/components/NavigationHeader/Navigation.jsx","../src/components/NavigationHeader/utils.js","../src/components/NavigationHeader/RightBlock.jsx","../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst OverflowLinks = ({ overflowLinks }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n if (!isNotEmpty(overflowLinks)) {\n return null;\n }\n\n return (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => {\n const isActive = to === pathname;\n const menuButton = (\n <MenuItem.Button\n {...{ isActive, to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n );\n\n if (\n isActive &&\n rest.moreOptions &&\n isNotEmpty(rest.moreOptions.menuItems)\n ) {\n return (\n <Dropdown\n customTarget={menuButton}\n key={`${key}-nested-dropdown`}\n position=\"right-start\"\n trigger=\"hover\"\n >\n <Menu>\n {rest.moreOptions.menuItems.map(\n ({ key, label, ...itemProps }) => (\n <MenuItem.Button key={key} {...itemProps}>\n {label}\n </MenuItem.Button>\n )\n )}\n </Menu>\n </Dropdown>\n );\n }\n\n return menuButton;\n })}\n </Menu>\n </Dropdown>\n );\n};\n\nOverflowLinks.propTypes = {\n /**\n * Array of overflow links to be displayed in the more dropdown\n */\n overflowLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n disabled: PropTypes.bool,\n moreOptions: PropTypes.shape({\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n};\n\nexport default OverflowLinks;\n","import classNames from \"classnames\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nimport MoreDropdown from \"components/MoreDropdown\";\n\nimport OverflowLinks from \"./OverflowLinks\";\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(\n ({\n className = \"\",\n key,\n label,\n disabled,\n labelProps,\n moreOptions,\n ...rest\n }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n className,\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n {...(labelProps || {})}\n >\n {label}\n </Typography>\n {(rest.isActive?.() || rest.to === pathname) && moreOptions && (\n <MoreDropdown {...moreOptions} />\n )}\n </NavLink>\n )\n )}\n <OverflowLinks {...{ overflowLinks }} />\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n className: PropTypes.string,\n labelProps: PropTypes.shape({ lineHeight: PropTypes.string }),\n moreOptions: PropTypes.shape({\n isVertical: PropTypes.bool,\n dropdownButtonProps: PropTypes.shape({\n size: PropTypes.string,\n className: PropTypes.string,\n }),\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","OverflowLinks","overflowLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","isMoreButtonActive","existsBy","isNotEmpty","buttonStyle","label","buttonProps","classNames","active","map","_ref2","key","disabled","rest","_objectWithoutProperties","_excluded","isActive","menuButton","_createElement","Button","concat","joinHyphenCase","isDisabled","onClick","e","preventDefault","moreOptions","menuItems","customTarget","trigger","_ref3","itemProps","_excluded2","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","visibleLinks","slice","_rest$isActive","_ref2$className","labelProps","NavLink","activeClassName","Typography","component","lineHeight","style","weight","call","MoreDropdown","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,CAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,GAAA,CAACC,IAAI,EA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lI,SAAS;AAC5CqH,gBAAgB,CAACzD,eAAe,GAAGA,eAAe;AAClDyD,gBAAgB,CAACc,gBAAgB,GAAGlD,UAAU;;;;"}
|
|
@@ -13,8 +13,9 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
13
13
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
14
14
|
var classnames = require('classnames');
|
|
15
15
|
var general = require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
16
|
-
var Dropdown = require('@bigbinary/neetoui/Dropdown');
|
|
17
16
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
17
|
+
var MoreDropdown = require('./MoreDropdown.js');
|
|
18
|
+
var Dropdown = require('@bigbinary/neetoui/Dropdown');
|
|
18
19
|
var reactI18next = require('react-i18next');
|
|
19
20
|
var React = require('react');
|
|
20
21
|
var PublishBlock = require('./PublishBlock.js');
|
|
@@ -30,7 +31,6 @@ require('@bigbinary/neetoui/Button');
|
|
|
30
31
|
require('@bigbinary/neetoui/Input');
|
|
31
32
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
32
33
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
33
|
-
require('./MoreDropdown.js');
|
|
34
34
|
require('@bigbinary/neeto-icons/MenuHorizontal');
|
|
35
35
|
require('@bigbinary/neeto-icons/MenuVertical');
|
|
36
36
|
require('@bigbinary/neeto-commons-frontend/react-utils/withT');
|
|
@@ -53,8 +53,8 @@ var DEFAULT_HOME_BUTTON_PROPS = {
|
|
|
53
53
|
icon: /*#__PURE__*/jsxRuntime.jsx(Home, {})
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
function ownKeys$
|
|
57
|
-
function _objectSpread$
|
|
56
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
57
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
58
58
|
var LeftBlock = function LeftBlock(_ref) {
|
|
59
59
|
var customHomeButtonProps = _ref.homeButtonProps,
|
|
60
60
|
homeUrl = _ref.homeUrl,
|
|
@@ -78,88 +78,128 @@ var LeftBlock = function LeftBlock(_ref) {
|
|
|
78
78
|
children: homeButtonProps.icon
|
|
79
79
|
})
|
|
80
80
|
})
|
|
81
|
-
}), neetoCist.isPresent(renameProps) && /*#__PURE__*/jsxRuntime.jsx(Rename, _objectSpread$
|
|
81
|
+
}), neetoCist.isPresent(renameProps) && /*#__PURE__*/jsxRuntime.jsx(Rename, _objectSpread$3({
|
|
82
82
|
dropdownItems: renameProps.dropdownItems,
|
|
83
83
|
value: renameProps.value
|
|
84
84
|
}, renameProps)), children]
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
var _excluded = ["key", "label", "disabled"],
|
|
89
|
-
_excluded2 = ["key", "
|
|
90
|
-
function ownKeys$
|
|
91
|
-
function _objectSpread$
|
|
88
|
+
var _excluded$1 = ["key", "to", "label", "disabled"],
|
|
89
|
+
_excluded2 = ["key", "label"];
|
|
90
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
91
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
92
92
|
var Menu = Dropdown.Menu,
|
|
93
93
|
MenuItem = Dropdown.MenuItem;
|
|
94
|
+
var OverflowLinks = function OverflowLinks(_ref) {
|
|
95
|
+
var overflowLinks = _ref.overflowLinks;
|
|
96
|
+
var _useLocation = reactRouterDom.useLocation(),
|
|
97
|
+
pathname = _useLocation.pathname;
|
|
98
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
99
|
+
t = _useTranslation.t;
|
|
100
|
+
var isMoreButtonActive = neetoCist.existsBy({
|
|
101
|
+
to: pathname
|
|
102
|
+
}, overflowLinks);
|
|
103
|
+
if (!neetoCist.isNotEmpty(overflowLinks)) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
|
|
107
|
+
buttonStyle: "text",
|
|
108
|
+
label: t("neetoMolecules.navigationHeader.more"),
|
|
109
|
+
position: "bottom-end",
|
|
110
|
+
buttonProps: {
|
|
111
|
+
className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
|
|
112
|
+
active: isMoreButtonActive
|
|
113
|
+
})
|
|
114
|
+
},
|
|
115
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
|
|
116
|
+
children: overflowLinks.map(function (_ref2) {
|
|
117
|
+
var key = _ref2.key,
|
|
118
|
+
to = _ref2.to,
|
|
119
|
+
label = _ref2.label,
|
|
120
|
+
disabled = _ref2.disabled,
|
|
121
|
+
rest = _objectWithoutProperties(_ref2, _excluded$1);
|
|
122
|
+
var isActive = to === pathname;
|
|
123
|
+
var menuButton = /*#__PURE__*/React.createElement(MenuItem.Button, _objectSpread$2({
|
|
124
|
+
isActive: isActive,
|
|
125
|
+
to: to,
|
|
126
|
+
"data-cy": "".concat(general.joinHyphenCase(key), "-more-tab"),
|
|
127
|
+
isDisabled: disabled,
|
|
128
|
+
key: key,
|
|
129
|
+
onClick: function onClick(e) {
|
|
130
|
+
return disabled && e.preventDefault();
|
|
131
|
+
}
|
|
132
|
+
}, rest), label);
|
|
133
|
+
if (isActive && rest.moreOptions && neetoCist.isNotEmpty(rest.moreOptions.menuItems)) {
|
|
134
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
|
|
135
|
+
customTarget: menuButton,
|
|
136
|
+
position: "right-start",
|
|
137
|
+
trigger: "hover",
|
|
138
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
|
|
139
|
+
children: rest.moreOptions.menuItems.map(function (_ref3) {
|
|
140
|
+
var key = _ref3.key,
|
|
141
|
+
label = _ref3.label,
|
|
142
|
+
itemProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
143
|
+
return /*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, _objectSpread$2(_objectSpread$2({}, itemProps), {}, {
|
|
144
|
+
children: label
|
|
145
|
+
}), key);
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
}, "".concat(key, "-nested-dropdown"));
|
|
149
|
+
}
|
|
150
|
+
return menuButton;
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
var _excluded = ["className", "key", "label", "disabled", "labelProps", "moreOptions"];
|
|
157
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
158
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
94
159
|
var NavigationLinks = function NavigationLinks(_ref) {
|
|
95
160
|
var headerLinks = _ref.headerLinks,
|
|
96
161
|
_ref$maxVisibleLinks = _ref.maxVisibleLinks,
|
|
97
162
|
maxVisibleLinks = _ref$maxVisibleLinks === void 0 ? 5 : _ref$maxVisibleLinks;
|
|
98
163
|
var _useLocation = reactRouterDom.useLocation(),
|
|
99
164
|
pathname = _useLocation.pathname;
|
|
100
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
101
|
-
t = _useTranslation.t;
|
|
102
165
|
var visibleLinks = headerLinks.slice(0, maxVisibleLinks);
|
|
103
166
|
var overflowLinks = headerLinks.slice(maxVisibleLinks);
|
|
104
|
-
var isMoreButtonActive = neetoCist.existsBy({
|
|
105
|
-
to: pathname
|
|
106
|
-
}, overflowLinks);
|
|
107
167
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
108
168
|
className: "font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6",
|
|
109
169
|
"data-cy": "navigation-header-navigation-links",
|
|
110
170
|
"data-testid": "navigation-header-navigation-links",
|
|
111
171
|
children: [visibleLinks.map(function (_ref2) {
|
|
112
|
-
var
|
|
172
|
+
var _rest$isActive;
|
|
173
|
+
var _ref2$className = _ref2.className,
|
|
174
|
+
className = _ref2$className === void 0 ? "" : _ref2$className,
|
|
175
|
+
key = _ref2.key,
|
|
113
176
|
label = _ref2.label,
|
|
114
177
|
disabled = _ref2.disabled,
|
|
178
|
+
labelProps = _ref2.labelProps,
|
|
179
|
+
moreOptions = _ref2.moreOptions,
|
|
115
180
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
116
|
-
return /*#__PURE__*/jsxRuntime.
|
|
181
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.NavLink, _objectSpread$1(_objectSpread$1({
|
|
117
182
|
activeClassName: "active",
|
|
118
183
|
"data-cy": "".concat(general.joinHyphenCase(key), "-tab"),
|
|
119
184
|
"data-testid": "".concat(general.joinHyphenCase(key), "-tab"),
|
|
120
|
-
className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", {
|
|
185
|
+
className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", className, {
|
|
121
186
|
disabled: disabled
|
|
122
187
|
}),
|
|
123
188
|
onClick: function onClick(e) {
|
|
124
189
|
return disabled && e.preventDefault();
|
|
125
190
|
}
|
|
126
191
|
}, rest), {}, {
|
|
127
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
192
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, _objectSpread$1(_objectSpread$1({
|
|
128
193
|
component: "span",
|
|
129
194
|
lineHeight: "normal",
|
|
130
195
|
style: "h4",
|
|
131
|
-
weight: "semibold"
|
|
196
|
+
weight: "semibold"
|
|
197
|
+
}, labelProps || {}), {}, {
|
|
132
198
|
children: label
|
|
133
|
-
})
|
|
199
|
+
})), (((_rest$isActive = rest.isActive) === null || _rest$isActive === void 0 ? void 0 : _rest$isActive.call(rest)) || rest.to === pathname) && moreOptions && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, _objectSpread$1({}, moreOptions))]
|
|
134
200
|
}), key);
|
|
135
|
-
}),
|
|
136
|
-
|
|
137
|
-
label: t("neetoMolecules.navigationHeader.more"),
|
|
138
|
-
position: "bottom-end",
|
|
139
|
-
buttonProps: {
|
|
140
|
-
className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
|
|
141
|
-
active: isMoreButtonActive
|
|
142
|
-
})
|
|
143
|
-
},
|
|
144
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
|
|
145
|
-
children: overflowLinks.map(function (_ref3) {
|
|
146
|
-
var key = _ref3.key,
|
|
147
|
-
to = _ref3.to,
|
|
148
|
-
label = _ref3.label,
|
|
149
|
-
disabled = _ref3.disabled,
|
|
150
|
-
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
151
|
-
return /*#__PURE__*/React.createElement(MenuItem.Button, _objectSpread$1({
|
|
152
|
-
to: to,
|
|
153
|
-
"data-cy": "".concat(general.joinHyphenCase(key), "-more-tab"),
|
|
154
|
-
isActive: to === pathname,
|
|
155
|
-
isDisabled: disabled,
|
|
156
|
-
key: key,
|
|
157
|
-
onClick: function onClick(e) {
|
|
158
|
-
return disabled && e.preventDefault();
|
|
159
|
-
}
|
|
160
|
-
}, rest), label);
|
|
161
|
-
})
|
|
162
|
-
})
|
|
201
|
+
}), /*#__PURE__*/jsxRuntime.jsx(OverflowLinks, {
|
|
202
|
+
overflowLinks: overflowLinks
|
|
163
203
|
})]
|
|
164
204
|
});
|
|
165
205
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationHeader.js","sources":["../../src/components/NavigationHeader/constants.jsx","../../src/components/NavigationHeader/LeftBlock.jsx","../../src/components/NavigationHeader/Navigation.jsx","../../src/components/NavigationHeader/utils.js","../../src/components/NavigationHeader/RightBlock.jsx","../../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(({ key, label, disabled, ...rest }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n </NavLink>\n ))}\n {isNotEmpty(overflowLinks) && (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => (\n <MenuItem.Button\n {...{ to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isActive={to === pathname}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n ))}\n </Menu>\n </Dropdown>\n )}\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","visibleLinks","slice","overflowLinks","isMoreButtonActive","existsBy","map","_ref2","key","label","disabled","rest","_objectWithoutProperties","_excluded","NavLink","activeClassName","concat","joinHyphenCase","classNames","onClick","e","preventDefault","Typography","component","lineHeight","style","weight","isNotEmpty","buttonStyle","buttonProps","active","_ref3","_excluded2","_createElement","Button","isActive","isDisabled","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,SAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,cAAA,CAACC,IAAI,EAAA,EAAE;A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,cAAA,CAAA,KAAA,EAAA;AACEU,MAAAA,SAAS,EAAC,6KAA6K;AACvL,MAAA,SAAA,EAAQ,mBAAmB;AAC3B,MAAA,aAAA,EAAY,mBAAmB;AAAAH,MAAAA,QAAA,eAE/BE,eAAA,CAAA,KAAA,EAAA;AAAKC,QAAAA,SAAS,EAAC,mBAAmB;AAAC8C,QAAAA,KAAK,EAAE8D,SAAU;QAAA/G,QAAA,EAAA,CACjDqG,eAAe,EACf,CAACM,QAAQ,IAAIL,eAAe,EAC5BC,gBAAgB;OACd;AAAC,KACH,CAAC,EACLI,QAAQ,iBACPlH,cAAA,CAAA,KAAA,EAAA;AAAKU,MAAAA,SAAS,EAAC,yJAAyJ;AAAAH,MAAAA,QAAA,EACrKsG;AAAe,KACb,CACN;AAAA,GACE,CAAC;AAEV;AAEAF,gBAAgB,CAACa,eAAe,GAAGtH,SAAS;AAC5CyG,gBAAgB,CAACpF,eAAe,GAAGA,eAAe;AAClDoF,gBAAgB,CAACc,gBAAgB,GAAGlD,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"NavigationHeader.js","sources":["../../src/components/NavigationHeader/constants.jsx","../../src/components/NavigationHeader/LeftBlock.jsx","../../src/components/NavigationHeader/OverflowLinks.jsx","../../src/components/NavigationHeader/Navigation.jsx","../../src/components/NavigationHeader/utils.js","../../src/components/NavigationHeader/RightBlock.jsx","../../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst OverflowLinks = ({ overflowLinks }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n if (!isNotEmpty(overflowLinks)) {\n return null;\n }\n\n return (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => {\n const isActive = to === pathname;\n const menuButton = (\n <MenuItem.Button\n {...{ isActive, to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n );\n\n if (\n isActive &&\n rest.moreOptions &&\n isNotEmpty(rest.moreOptions.menuItems)\n ) {\n return (\n <Dropdown\n customTarget={menuButton}\n key={`${key}-nested-dropdown`}\n position=\"right-start\"\n trigger=\"hover\"\n >\n <Menu>\n {rest.moreOptions.menuItems.map(\n ({ key, label, ...itemProps }) => (\n <MenuItem.Button key={key} {...itemProps}>\n {label}\n </MenuItem.Button>\n )\n )}\n </Menu>\n </Dropdown>\n );\n }\n\n return menuButton;\n })}\n </Menu>\n </Dropdown>\n );\n};\n\nOverflowLinks.propTypes = {\n /**\n * Array of overflow links to be displayed in the more dropdown\n */\n overflowLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n disabled: PropTypes.bool,\n moreOptions: PropTypes.shape({\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n};\n\nexport default OverflowLinks;\n","import classNames from \"classnames\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nimport MoreDropdown from \"components/MoreDropdown\";\n\nimport OverflowLinks from \"./OverflowLinks\";\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(\n ({\n className = \"\",\n key,\n label,\n disabled,\n labelProps,\n moreOptions,\n ...rest\n }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n className,\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n {...(labelProps || {})}\n >\n {label}\n </Typography>\n {(rest.isActive?.() || rest.to === pathname) && moreOptions && (\n <MoreDropdown {...moreOptions} />\n )}\n </NavLink>\n )\n )}\n <OverflowLinks {...{ overflowLinks }} />\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n className: PropTypes.string,\n labelProps: PropTypes.shape({ lineHeight: PropTypes.string }),\n moreOptions: PropTypes.shape({\n isVertical: PropTypes.bool,\n dropdownButtonProps: PropTypes.shape({\n size: PropTypes.string,\n className: PropTypes.string,\n }),\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","OverflowLinks","overflowLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","isMoreButtonActive","existsBy","isNotEmpty","buttonStyle","label","buttonProps","classNames","active","map","_ref2","key","disabled","rest","_objectWithoutProperties","_excluded","isActive","menuButton","_createElement","Button","concat","joinHyphenCase","isDisabled","onClick","e","preventDefault","moreOptions","menuItems","customTarget","trigger","_ref3","itemProps","_excluded2","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","visibleLinks","slice","_rest$isActive","_ref2$className","labelProps","NavLink","activeClassName","Typography","component","lineHeight","style","weight","call","MoreDropdown","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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AA,CACjDiH,eAAe,EACf,CAACM,QAAQ,IAAIL,eAAe,EAC5BC,gBAAgB;OACd;AAAC,KACH,CAAC,EACLI,QAAQ,iBACP9H,cAAA,CAAA,KAAA,EAAA;AAAKU,MAAAA,SAAS,EAAC,yJAAyJ;AAAAH,MAAAA,QAAA,EACrKkH;AAAe,KACb,CACN;AAAA,GACE,CAAC;AAEV;AAEAF,gBAAgB,CAACa,eAAe,GAAGlI,SAAS;AAC5CqH,gBAAgB,CAACzD,eAAe,GAAGA,eAAe;AAClDyD,gBAAgB,CAACc,gBAAgB,GAAGlD,UAAU;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.61",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -18,10 +18,33 @@ type HomeButtonPropType = {
|
|
|
18
18
|
tooltip: TooltipPropType;
|
|
19
19
|
icon: React.ReactNode;
|
|
20
20
|
};
|
|
21
|
+
type MenuItemPropType = {
|
|
22
|
+
key: string;
|
|
23
|
+
label: string;
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
isDisabled?: boolean;
|
|
27
|
+
tooltipProps?: {
|
|
28
|
+
content: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type MoreOptionsPropType = {
|
|
32
|
+
isVertical?: boolean;
|
|
33
|
+
dropdownButtonProps?: {
|
|
34
|
+
size?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
menuItems?: MenuItemPropType[];
|
|
38
|
+
};
|
|
21
39
|
type HeaderLinkPropType = {
|
|
22
40
|
key: string;
|
|
23
41
|
to: string;
|
|
24
42
|
label: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
labelProps?: {
|
|
45
|
+
lineHeight?: string;
|
|
46
|
+
};
|
|
47
|
+
moreOptions?: MoreOptionsPropType;
|
|
25
48
|
} & NavLinkProps;
|
|
26
49
|
type RightActionBlockPropTypes = {
|
|
27
50
|
isDraftBlockHidden: boolean;
|
|
@@ -46,6 +69,9 @@ type NavigationLinkPropsType = {
|
|
|
46
69
|
headerLinks: HeaderLinkPropType[];
|
|
47
70
|
maxVisibleLinks?: number;
|
|
48
71
|
};
|
|
72
|
+
type OverflowLinksPropsType = {
|
|
73
|
+
overflowLinks: HeaderLinkPropType[];
|
|
74
|
+
};
|
|
49
75
|
type LeftBlockPropTypes = {
|
|
50
76
|
homeButtonProps?: HomeButtonPropType;
|
|
51
77
|
homeUrl: string;
|
|
@@ -54,7 +80,7 @@ type LeftBlockPropTypes = {
|
|
|
54
80
|
};
|
|
55
81
|
/**
|
|
56
82
|
*
|
|
57
|
-
* A common component to use as navigation header.
|
|
83
|
+
* A common component to use as navigation header with support for nested dropdown menus.
|
|
58
84
|
*
|
|
59
85
|
* @example
|
|
60
86
|
*
|
|
@@ -106,6 +132,8 @@ type LeftBlockPropTypes = {
|
|
|
106
132
|
* @endexample
|
|
107
133
|
* To specify the content to be rendered at the center of the NavigationHeader.
|
|
108
134
|
*
|
|
135
|
+
* Each object in the headerLinks array can have the following properties:
|
|
136
|
+
*
|
|
109
137
|
* @example
|
|
110
138
|
*
|
|
111
139
|
* import NavigationHeader from "@bigbinary/neeto-molecules/NavigationHeader";
|
|
@@ -115,15 +143,48 @@ type LeftBlockPropTypes = {
|
|
|
115
143
|
* navigationLinks={
|
|
116
144
|
* <NavigationHeader.NavigationLinks
|
|
117
145
|
* headerLinks={[
|
|
118
|
-
* {
|
|
119
|
-
*
|
|
146
|
+
* {
|
|
147
|
+
* key: "build",
|
|
148
|
+
* to: "/build",
|
|
149
|
+
* label: "Build",
|
|
150
|
+
* className: "custom-link-class"
|
|
151
|
+
* },
|
|
152
|
+
* {
|
|
153
|
+
* key: "design",
|
|
154
|
+
* to: "/design",
|
|
155
|
+
* label: "Design",
|
|
156
|
+
* labelProps: { lineHeight: "tight" }
|
|
157
|
+
* },
|
|
120
158
|
* {
|
|
121
159
|
* key: "configure",
|
|
122
160
|
* to: "/configure",
|
|
123
161
|
* label: "Configure",
|
|
124
|
-
* exact: true, //Additional props passed to Navlink component
|
|
162
|
+
* exact: true, // Additional props passed to Navlink component
|
|
163
|
+
* moreOptions: {
|
|
164
|
+
* isVertical: true,
|
|
165
|
+
* dropdownButtonProps: {
|
|
166
|
+
* size: "small",
|
|
167
|
+
* className: "custom-dropdown-class"
|
|
168
|
+
* },
|
|
169
|
+
* menuItems: [
|
|
170
|
+
* {
|
|
171
|
+
* key: "settings",
|
|
172
|
+
* label: "Settings",
|
|
173
|
+
* onClick: () => console.log("Settings clicked")
|
|
174
|
+
* },
|
|
175
|
+
* {
|
|
176
|
+
* key: "preferences",
|
|
177
|
+
* label: "Preferences",
|
|
178
|
+
* disabled: true,
|
|
179
|
+
* tooltipProps: {
|
|
180
|
+
* content: "This feature is coming soon"
|
|
181
|
+
* }
|
|
182
|
+
* }
|
|
183
|
+
* ]
|
|
184
|
+
* }
|
|
125
185
|
* },
|
|
126
186
|
* ]}
|
|
187
|
+
* maxVisibleLinks={3}
|
|
127
188
|
* />
|
|
128
189
|
* }
|
|
129
190
|
* rightActionBlock={
|
|
@@ -176,6 +237,7 @@ declare const NavigationHeader: React.FC<{
|
|
|
176
237
|
RightActionBlock: React.FC<RightActionBlockPropTypes>;
|
|
177
238
|
NavigationLinks: React.FC<NavigationLinkPropsType>;
|
|
178
239
|
LeftActionBlock: React.FC<LeftBlockPropTypes>;
|
|
240
|
+
OverflowLinks: React.FC<OverflowLinksPropsType>;
|
|
179
241
|
};
|
|
180
242
|
|
|
181
243
|
export { NavigationHeader as default };
|