@bigbinary/neeto-molecules 1.2.5-beta → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/Sidebar.js +114 -226
- package/dist/Sidebar.js.map +1 -1
- package/dist/SuffixedInput.js +151 -0
- package/dist/SuffixedInput.js.map +1 -0
- package/package.json +1 -1
- package/src/translations/en.json +1 -2
- package/types/SuffixedInput.d.ts +46 -0
package/README.md
CHANGED
|
@@ -63,6 +63,7 @@ https://neeto-molecules.neeto.com/
|
|
|
63
63
|
- [Metadata](./docs/components.md#metadata)
|
|
64
64
|
- [DocumentEditor](./docs/components.md#DocumentEditor)
|
|
65
65
|
- [Taxonomy](./docs/components.md#Taxonomy)
|
|
66
|
+
- [SuffixedInput](./docs/components.md#SuffixedInput
|
|
66
67
|
|
|
67
68
|
## Installation Instructions
|
|
68
69
|
|
package/dist/Sidebar.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { useState, forwardRef, useEffect } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { capitalize, truncate, isPresent, findBy, notEquals, isNotPresent } from '@bigbinary/neeto-cist';
|
|
4
3
|
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
5
4
|
import { useFetchNeetoApps, useLocalStorage } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
6
5
|
import { Typography, Input, Tooltip, Spinner, Avatar, Button } from '@bigbinary/neetoui';
|
|
7
|
-
import { toLower, curry, is, includes, __,
|
|
6
|
+
import { toLower, all, mergeDeepLeft, curry, is, includes, __, not } from 'ramda';
|
|
8
7
|
import { useTranslation } from 'react-i18next';
|
|
9
|
-
import { Link,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { Link, useLocation, NavLink } from 'react-router-dom';
|
|
9
|
+
import { NeetoIcon, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help, Down } from '@bigbinary/neeto-icons';
|
|
10
|
+
import { capitalize, truncate, isPresent, findBy, isNotPresent } from '@bigbinary/neeto-cist';
|
|
12
11
|
import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
|
|
12
|
+
import { t as t$1 } from 'i18next';
|
|
13
13
|
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
|
|
14
14
|
import KeyboardShortcuts from '@bigbinary/neeto-molecules/KeyboardShortcuts';
|
|
15
15
|
import * as ProductTypefaceLogos from '@bigbinary/neeto-icons/typeface-logos';
|
|
@@ -83,42 +83,6 @@ var Chevron = function Chevron(_ref) {
|
|
|
83
83
|
}));
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
87
|
-
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
88
|
-
var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
|
|
89
|
-
var DEFAULT_HELP_LINK_PROPS = {
|
|
90
|
-
liveChatProps: {
|
|
91
|
-
label: t$1("neetoMolecules.sidebar.helpLinks.liveChat"),
|
|
92
|
-
icon: ChatEmpty,
|
|
93
|
-
"data-cy": "help-link-live-chat-button",
|
|
94
|
-
onClick: function onClick() {
|
|
95
|
-
var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
|
|
96
|
-
(_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
|
|
97
|
-
(_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
helpCenterProps: {
|
|
101
|
-
label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
102
|
-
icon: Book,
|
|
103
|
-
"data-cy": "help-link-help-center-button",
|
|
104
|
-
href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
|
|
105
|
-
target: "_blank"
|
|
106
|
-
},
|
|
107
|
-
changelogProps: {
|
|
108
|
-
id: CHANGELOG_WIDGET_TRIGGER_ID,
|
|
109
|
-
label: t$1("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
110
|
-
icon: Gift,
|
|
111
|
-
"data-cy": "help-link-changelog-button"
|
|
112
|
-
},
|
|
113
|
-
keyboardShortcutProps: {
|
|
114
|
-
label: t$1("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
115
|
-
icon: Keyboard,
|
|
116
|
-
"data-cy": "help-link-keyboard-shortcut-button"
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
var NAVLINK_KEYS_TO_OMIT = ["Component", "component"];
|
|
120
|
-
var SETTINGS = "Settings";
|
|
121
|
-
|
|
122
86
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
123
87
|
|
|
124
88
|
var css$1 = ".neeto-molecules-app-switcher__wrapper{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:column;justify-content:flex-start;max-width:100%;overflow-y:auto;padding:40px;position:relative;transition:all .3s;width:100%}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__wrapper{padding:32px}}@media screen and (max-width:768px){.neeto-molecules-app-switcher__wrapper{padding:16px}}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(100%,1fr))}}.neeto-molecules-app-switcher__header{align-items:center;display:flex;gap:32px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}@media only screen and (max-width:768px){.neeto-molecules-app-switcher__header{align-items:flex-start;flex-direction:column-reverse;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__header h1{font-size:24px}}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-app-switcher__search-wrapper{flex-grow:0;width:296px}}.neeto-molecules-app-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-app-switcher-link{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:2px;cursor:pointer;display:flex;gap:12px;max-width:100%;padding:12px 16px;text-decoration:none;transition:background-color .3s ease-in-out;width:100%}.neeto-molecules-app-switcher-link:focus,.neeto-molecules-app-switcher-link:focus-visible{outline:none}.neeto-molecules-app-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link:not(.neeto-molecules-app-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-app-switcher-link__icon-holder{align-items:center;border-radius:var(--neeto-ui-rounded-lg);display:flex;flex-shrink:0;height:42px;justify-content:center;width:42px}.neeto-molecules-app-switcher-link__content{flex-grow:1}.neeto-molecules-app-switcher-link__content span{display:block}";
|
|
@@ -233,7 +197,7 @@ var AppSwitcher = function AppSwitcher() {
|
|
|
233
197
|
}, /*#__PURE__*/React.createElement(Body, null));
|
|
234
198
|
};
|
|
235
199
|
|
|
236
|
-
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;width:240px;width:var(--neeto-molecules-sidebar-width)}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-1)}}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-app-switcher-popup-wrapper,.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-app-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode{padding-top:0}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__header{padding-top:24px}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__links{margin-bottom:0}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink-wrapper{margin:0!important;padding:0!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link{--neeto-ui-text-body2:16px;gap:4px;padding:12px 4px;position:sticky;top:0;z-index:1}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink{--neeto-ui-text-body2:15px;border-top:1px solid rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);margin-bottom:0!important;padding-bottom:8px!important;padding-top:8px!important}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink{--neeto-ui-text-body2:13px;padding-left:40px!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink{margin-bottom:4px;padding:4px 4px 4px 30px!important;position:relative}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink:hover{background-color:rgb(var(--neeto-ui-gray-100))}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active{background-color:rgb(var(--neeto-ui-primary-100))!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active:before{background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded);content:\"\";height:100%;left:-1px;position:absolute;top:0;width:3px}";
|
|
200
|
+
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;width:240px;width:var(--neeto-molecules-sidebar-width)}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-1)}}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-app-switcher-popup-wrapper,.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-app-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}";
|
|
237
201
|
n(css,{});
|
|
238
202
|
|
|
239
203
|
var AppSwitcherButton = function AppSwitcherButton() {
|
|
@@ -284,10 +248,41 @@ var AppSwitcherButton = function AppSwitcherButton() {
|
|
|
284
248
|
}, t("neetoMolecules.sidebar.productSwitcher"))));
|
|
285
249
|
};
|
|
286
250
|
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
251
|
+
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
252
|
+
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
253
|
+
var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
|
|
254
|
+
var DEFAULT_HELP_LINK_PROPS = {
|
|
255
|
+
liveChatProps: {
|
|
256
|
+
label: t$1("neetoMolecules.sidebar.helpLinks.liveChat"),
|
|
257
|
+
icon: ChatEmpty,
|
|
258
|
+
"data-cy": "help-link-live-chat-button",
|
|
259
|
+
onClick: function onClick() {
|
|
260
|
+
var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
|
|
261
|
+
(_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
|
|
262
|
+
(_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
helpCenterProps: {
|
|
266
|
+
label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
267
|
+
icon: Book,
|
|
268
|
+
"data-cy": "help-link-help-center-button",
|
|
269
|
+
href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
|
|
270
|
+
target: "_blank"
|
|
271
|
+
},
|
|
272
|
+
changelogProps: {
|
|
273
|
+
id: CHANGELOG_WIDGET_TRIGGER_ID,
|
|
274
|
+
label: t$1("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
275
|
+
icon: Gift,
|
|
276
|
+
"data-cy": "help-link-changelog-button"
|
|
277
|
+
},
|
|
278
|
+
keyboardShortcutProps: {
|
|
279
|
+
label: t$1("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
280
|
+
icon: Keyboard,
|
|
281
|
+
"data-cy": "help-link-keyboard-shortcut-button"
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var isSubRouteActive = function isSubRouteActive(subRoute, location) {
|
|
291
286
|
var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
|
|
292
287
|
var targetUrl = new URL(subRoute, window.location.origin);
|
|
293
288
|
if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
|
|
@@ -295,28 +290,15 @@ var isSubRouteActive = function isSubRouteActive(_ref) {
|
|
|
295
290
|
}
|
|
296
291
|
var targetSearchParams = targetUrl.searchParams;
|
|
297
292
|
var targetSearchKeys = Array.from(targetSearchParams.keys());
|
|
298
|
-
|
|
299
|
-
var currentUrlWithSearch = currentBrowserUrl.pathname + currentBrowserUrl.search;
|
|
300
|
-
var isLinkActive = all(function (key) {
|
|
293
|
+
return all(function (key) {
|
|
301
294
|
return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
|
|
302
295
|
}, targetSearchKeys);
|
|
303
|
-
if (isSettingsItems) {
|
|
304
|
-
return isLinkActive && equals(currentUrlWithSearch, targetUrlWithSearch);
|
|
305
|
-
}
|
|
306
|
-
return isLinkActive;
|
|
307
296
|
};
|
|
308
297
|
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
309
298
|
var _globalProps$user, _globalProps$user2;
|
|
310
299
|
var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
|
|
311
300
|
return "sidebarState-".concat(user);
|
|
312
301
|
};
|
|
313
|
-
var filterByPermissions = curry(function (_ref2) {
|
|
314
|
-
var permissions = _ref2.permissions;
|
|
315
|
-
if (permissions) {
|
|
316
|
-
return is(Array, permissions) ? permissions.some(includes(__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
|
|
317
|
-
}
|
|
318
|
-
return true;
|
|
319
|
-
});
|
|
320
302
|
|
|
321
303
|
var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
322
304
|
var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
|
|
@@ -475,9 +457,9 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
475
457
|
return target;
|
|
476
458
|
}
|
|
477
459
|
|
|
478
|
-
var _excluded$
|
|
479
|
-
function ownKeys$
|
|
480
|
-
function _objectSpread$
|
|
460
|
+
var _excluded$2 = ["onClick", "label", "icon"];
|
|
461
|
+
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; }
|
|
462
|
+
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), !0).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; }
|
|
481
463
|
var LinkSection = function LinkSection(_ref) {
|
|
482
464
|
var links = _ref.links;
|
|
483
465
|
return /*#__PURE__*/React.createElement("ul", {
|
|
@@ -487,7 +469,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
487
469
|
label = _ref2.label,
|
|
488
470
|
_ref2$icon = _ref2.icon,
|
|
489
471
|
icon = _ref2$icon === void 0 ? null : _ref2$icon,
|
|
490
|
-
otherProps = _objectWithoutProperties(_ref2, _excluded$
|
|
472
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded$2);
|
|
491
473
|
return /*#__PURE__*/React.createElement("li", {
|
|
492
474
|
className: "neeto-molecules-profile-sublist__item",
|
|
493
475
|
key: idx
|
|
@@ -497,7 +479,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
497
479
|
iconPosition: "left",
|
|
498
480
|
iconSize: 18,
|
|
499
481
|
style: "text"
|
|
500
|
-
}, _objectSpread$
|
|
482
|
+
}, _objectSpread$2({
|
|
501
483
|
icon: icon,
|
|
502
484
|
label: label,
|
|
503
485
|
onClick: onClick
|
|
@@ -600,9 +582,9 @@ var HelpSection = function HelpSection(_ref, ref) {
|
|
|
600
582
|
};
|
|
601
583
|
var HelpSection$1 = /*#__PURE__*/forwardRef(HelpSection);
|
|
602
584
|
|
|
603
|
-
var _excluded$
|
|
604
|
-
function ownKeys$
|
|
605
|
-
function _objectSpread$
|
|
585
|
+
var _excluded$1 = ["label"];
|
|
586
|
+
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; }
|
|
587
|
+
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), !0).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; }
|
|
606
588
|
var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
607
589
|
var helpLinkOverrides = _ref.helpLinkOverrides,
|
|
608
590
|
changesCount = _ref.changesCount;
|
|
@@ -610,7 +592,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
610
592
|
_KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
|
|
611
593
|
setIsOpen = _KeyboardShortcuts$us2[1];
|
|
612
594
|
var helpLinks = Object.keys(DEFAULT_HELP_LINK_PROPS).map(function (key) {
|
|
613
|
-
return _objectSpread$
|
|
595
|
+
return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
|
|
614
596
|
onClick: function onClick() {
|
|
615
597
|
return setIsOpen(true);
|
|
616
598
|
}
|
|
@@ -625,7 +607,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
625
607
|
className: "neeto-molecules-help-sublist"
|
|
626
608
|
}, helpLinks.map(function (_ref3, idx) {
|
|
627
609
|
var label = _ref3.label,
|
|
628
|
-
buttonProps = _objectWithoutProperties(_ref3, _excluded$
|
|
610
|
+
buttonProps = _objectWithoutProperties(_ref3, _excluded$1);
|
|
629
611
|
return /*#__PURE__*/React.createElement("li", {
|
|
630
612
|
className: "neeto-molecules-help-sublist__item",
|
|
631
613
|
key: idx
|
|
@@ -717,74 +699,26 @@ var Header = function Header(_ref) {
|
|
|
717
699
|
};
|
|
718
700
|
var Header$1 = /*#__PURE__*/React.memo(Header);
|
|
719
701
|
|
|
720
|
-
var _excluded
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
level = _ref$level === void 0 ? 0 : _ref$level,
|
|
725
|
-
_ref$isSettingsItems = _ref.isSettingsItems,
|
|
726
|
-
isSettingsItems = _ref$isSettingsItems === void 0 ? false : _ref$isSettingsItems;
|
|
727
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
728
|
-
className: "neeto-molecules-sidebar__sublink-wrapper ml-".concat(level * 2),
|
|
729
|
-
"data-cy": "sidebar-sub-link-wrapper"
|
|
730
|
-
}, items.filter(filterByPermissions).map(function (_ref2, index) {
|
|
731
|
-
var label = _ref2.label,
|
|
732
|
-
to = _ref2.to,
|
|
733
|
-
count = _ref2.count,
|
|
734
|
-
dataCy = _ref2.dataCy,
|
|
735
|
-
subItems = _ref2.items,
|
|
736
|
-
otherProps = _objectWithoutProperties(_ref2, _excluded$2);
|
|
737
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
738
|
-
key: index
|
|
739
|
-
}, /*#__PURE__*/React.createElement(NavLink, _extends({
|
|
740
|
-
to: to,
|
|
741
|
-
activeClassName: "active",
|
|
742
|
-
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-select-none neeto-molecules-sidebar__sublink",
|
|
743
|
-
"data-cy": "".concat(dataCy, "-sub-link"),
|
|
744
|
-
key: index,
|
|
745
|
-
isActive: function isActive() {
|
|
746
|
-
return isSubRouteActive({
|
|
747
|
-
subRoute: to,
|
|
748
|
-
location: location,
|
|
749
|
-
isSettingsItems: isSettingsItems
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
}, omit(NAVLINK_KEYS_TO_OMIT, otherProps)), /*#__PURE__*/React.createElement(Typography, {
|
|
753
|
-
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
754
|
-
component: "span",
|
|
755
|
-
"data-cy": "".concat(dataCy, "-sub-link-label"),
|
|
756
|
-
style: "body2"
|
|
757
|
-
}, label), /*#__PURE__*/React.createElement(Typography, {
|
|
758
|
-
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
759
|
-
component: "span",
|
|
760
|
-
"data-cy": "".concat(dataCy, "-sub-link-count"),
|
|
761
|
-
style: "body2"
|
|
762
|
-
}, count > 999 ? "999+" : count)), isPresent(subItems) && /*#__PURE__*/React.createElement(Items, {
|
|
763
|
-
isSettingsItems: isSettingsItems,
|
|
764
|
-
items: subItems,
|
|
765
|
-
level: inc(level)
|
|
766
|
-
}));
|
|
767
|
-
}));
|
|
768
|
-
};
|
|
769
|
-
|
|
770
|
-
var _excluded$1 = ["label", "to", "icon", "items"];
|
|
771
|
-
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; }
|
|
772
|
-
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), !0).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; }
|
|
702
|
+
var _excluded = ["label", "to", "icon", "items"],
|
|
703
|
+
_excluded2 = ["label", "to", "count", "data-cy"];
|
|
704
|
+
function ownKeys(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; }
|
|
705
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
773
706
|
var Links = function Links(_ref) {
|
|
774
|
-
var navLinks = _ref.navLinks
|
|
775
|
-
|
|
707
|
+
var navLinks = _ref.navLinks;
|
|
708
|
+
var location = useLocation();
|
|
776
709
|
var _useState = useState(true),
|
|
777
710
|
_useState2 = _slicedToArray(_useState, 2),
|
|
778
711
|
isActiveLinkExpanded = _useState2[0],
|
|
779
712
|
setIsActiveLinkExpanded = _useState2[1];
|
|
780
|
-
var
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
713
|
+
var filterByPermissions = curry(function (_ref2) {
|
|
714
|
+
var permissions = _ref2.permissions;
|
|
715
|
+
if (permissions) {
|
|
716
|
+
return is(Array, permissions) ? permissions.some(includes(__, globalProps$1.permissions)) : globalProps$1.permissions.includes(permissions);
|
|
717
|
+
}
|
|
718
|
+
return true;
|
|
719
|
+
});
|
|
720
|
+
var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
|
|
786
721
|
if (isNotPresent(items)) return;
|
|
787
|
-
equals(navLink.label, SETTINGS) && setSelectedNavLink(navLink);
|
|
788
722
|
if (isActive()) {
|
|
789
723
|
setIsActiveLinkExpanded(not);
|
|
790
724
|
event.preventDefault();
|
|
@@ -794,12 +728,12 @@ var Links = function Links(_ref) {
|
|
|
794
728
|
};
|
|
795
729
|
return /*#__PURE__*/React.createElement("div", {
|
|
796
730
|
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
|
|
797
|
-
}, navLinks.filter(filterByPermissions).map(function (
|
|
798
|
-
var label =
|
|
799
|
-
to =
|
|
800
|
-
icon =
|
|
801
|
-
items =
|
|
802
|
-
otherProps = _objectWithoutProperties(
|
|
731
|
+
}, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
|
|
732
|
+
var label = _ref3.label,
|
|
733
|
+
to = _ref3.to,
|
|
734
|
+
icon = _ref3.icon,
|
|
735
|
+
items = _ref3.items,
|
|
736
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded);
|
|
803
737
|
var IconSVG = icon;
|
|
804
738
|
var url = new URL(to, window.location.href);
|
|
805
739
|
var isActive = function isActive() {
|
|
@@ -807,19 +741,14 @@ var Links = function Links(_ref) {
|
|
|
807
741
|
};
|
|
808
742
|
var isMenuExpanded = isActive() && isActiveLinkExpanded;
|
|
809
743
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
810
|
-
key:
|
|
744
|
+
key: mainIndex
|
|
811
745
|
}, /*#__PURE__*/React.createElement(NavLink, _extends({
|
|
812
746
|
activeClassName: "active",
|
|
813
747
|
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
|
|
814
748
|
onClick: function onClick(event) {
|
|
815
|
-
return handleNavLinkClick(
|
|
816
|
-
event: event,
|
|
817
|
-
isActive: isActive,
|
|
818
|
-
items: items,
|
|
819
|
-
navLink: navLink
|
|
820
|
-
});
|
|
749
|
+
return handleNavLinkClick(event, isActive, items);
|
|
821
750
|
}
|
|
822
|
-
}, _objectSpread
|
|
751
|
+
}, _objectSpread({
|
|
823
752
|
isActive: isActive,
|
|
824
753
|
to: to
|
|
825
754
|
}, otherProps)), icon && /*#__PURE__*/React.createElement("span", {
|
|
@@ -830,62 +759,42 @@ var Links = function Links(_ref) {
|
|
|
830
759
|
component: "span",
|
|
831
760
|
style: "body2",
|
|
832
761
|
weight: "normal"
|
|
833
|
-
}, label), items &&
|
|
762
|
+
}, label), items && /*#__PURE__*/React.createElement("span", {
|
|
834
763
|
className: classnames("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
|
|
835
764
|
"neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
|
|
836
765
|
})
|
|
837
766
|
}, /*#__PURE__*/React.createElement(Down, {
|
|
838
767
|
size: 16
|
|
839
|
-
}))), items &&
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
activeClassName: "active",
|
|
870
|
-
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link"
|
|
871
|
-
}, _objectSpread({
|
|
872
|
-
isActive: isActive,
|
|
873
|
-
to: to
|
|
874
|
-
}, otherProps)), /*#__PURE__*/React.createElement(Tooltip, {
|
|
875
|
-
content: t("neetoMolecules.sidebar.goBack"),
|
|
876
|
-
position: "top"
|
|
877
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
878
|
-
className: "neeto-molecules-sidebar__link-icon",
|
|
879
|
-
"data-testid": "".concat(label, "-go-back-button"),
|
|
880
|
-
onClick: handleGoBack
|
|
881
|
-
}, /*#__PURE__*/React.createElement(Left, null))), /*#__PURE__*/React.createElement(Typography, {
|
|
882
|
-
className: "neeto-molecules-sidebar__link-label",
|
|
883
|
-
component: "span",
|
|
884
|
-
style: "body2",
|
|
885
|
-
weight: "normal"
|
|
886
|
-
}, label)), items && /*#__PURE__*/React.createElement(Items, {
|
|
887
|
-
items: items,
|
|
888
|
-
isSettingsItems: true
|
|
768
|
+
}))), items && isMenuExpanded && /*#__PURE__*/React.createElement("div", {
|
|
769
|
+
className: "neeto-molecules-sidebar__sublink-wrapper",
|
|
770
|
+
"data-cy": "sidebar-sub-link-wrapper"
|
|
771
|
+
}, items.filter(filterByPermissions).map(function (_ref4, subIndex) {
|
|
772
|
+
var subLabel = _ref4.label,
|
|
773
|
+
subRoute = _ref4.to,
|
|
774
|
+
count = _ref4.count,
|
|
775
|
+
dataCy = _ref4["data-cy"],
|
|
776
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded2);
|
|
777
|
+
return /*#__PURE__*/React.createElement(NavLink, _extends({
|
|
778
|
+
activeClassName: "active",
|
|
779
|
+
className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
|
|
780
|
+
"data-cy": "".concat(dataCy, "-sub-link"),
|
|
781
|
+
isActive: function isActive() {
|
|
782
|
+
return isSubRouteActive(subRoute, location);
|
|
783
|
+
},
|
|
784
|
+
key: subIndex,
|
|
785
|
+
to: subRoute
|
|
786
|
+
}, otherProps), /*#__PURE__*/React.createElement(Typography, {
|
|
787
|
+
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
788
|
+
component: "span",
|
|
789
|
+
"data-cy": "".concat(dataCy, "-sub-link-label"),
|
|
790
|
+
style: "body2"
|
|
791
|
+
}, subLabel), /*#__PURE__*/React.createElement(Typography, {
|
|
792
|
+
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
793
|
+
component: "span",
|
|
794
|
+
"data-cy": "".concat(dataCy, "-sub-link-count"),
|
|
795
|
+
style: "body2"
|
|
796
|
+
}, count > 999 ? "999+" : count));
|
|
797
|
+
})));
|
|
889
798
|
}));
|
|
890
799
|
};
|
|
891
800
|
|
|
@@ -904,14 +813,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
904
813
|
_useState2 = _slicedToArray(_useState, 2),
|
|
905
814
|
isAppSwitcherOpen = _useState2[0],
|
|
906
815
|
setIsAppSwitcherOpen = _useState2[1];
|
|
907
|
-
var _useState3 = useState(
|
|
816
|
+
var _useState3 = useState(false),
|
|
908
817
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
var _useState5 = useState(false),
|
|
912
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
913
|
-
isSidebarPaneOpen = _useState6[0],
|
|
914
|
-
setIsSidebarPaneOpen = _useState6[1];
|
|
818
|
+
isSidebarPaneOpen = _useState4[0],
|
|
819
|
+
setIsSidebarPaneOpen = _useState4[1];
|
|
915
820
|
var _useLocalStorage = useLocalStorage(getSidebarStateLocalStorageKey(), false),
|
|
916
821
|
_useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
|
|
917
822
|
isSidebarCollapsed = _useLocalStorage2[0],
|
|
@@ -939,17 +844,6 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
939
844
|
};
|
|
940
845
|
}, []);
|
|
941
846
|
var productName = globalProps$1.appName.substr(5).toLowerCase();
|
|
942
|
-
useEffect(function () {
|
|
943
|
-
var currentLink = navLinks.find(function (_ref2) {
|
|
944
|
-
var to = _ref2.to,
|
|
945
|
-
isActive = _ref2.isActive;
|
|
946
|
-
var url = new URL(to, window.location.href);
|
|
947
|
-
return is(Function, isActive) ? isActive() : location.pathname.startsWith(url.pathname);
|
|
948
|
-
});
|
|
949
|
-
if (isPresent(currentLink) && equals(currentLink.label, SETTINGS)) {
|
|
950
|
-
setSelectedNavLink(currentLink);
|
|
951
|
-
}
|
|
952
|
-
}, []);
|
|
953
847
|
return /*#__PURE__*/React.createElement("div", {
|
|
954
848
|
"data-testid": "sidebar-container",
|
|
955
849
|
className: classnames("neeto-molecules-sidebar__wrapper", {
|
|
@@ -961,20 +855,14 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
961
855
|
setIsSidebarPaneOpen(false);
|
|
962
856
|
}
|
|
963
857
|
}), /*#__PURE__*/React.createElement("div", {
|
|
858
|
+
className: "neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden",
|
|
964
859
|
"data-cy": "sidebar-wrapper",
|
|
965
|
-
"data-testid": "sidebar"
|
|
966
|
-
className: classnames("neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden", {
|
|
967
|
-
"neeto-molecules-sidebar--focus-mode": isPresent(selectedNavLink)
|
|
968
|
-
})
|
|
860
|
+
"data-testid": "sidebar"
|
|
969
861
|
}, /*#__PURE__*/React.createElement(Header$1, {
|
|
970
862
|
customLogo: customLogo
|
|
971
|
-
}),
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}) : /*#__PURE__*/React.createElement(Links, {
|
|
975
|
-
navLinks: navLinks,
|
|
976
|
-
setSelectedNavLink: setSelectedNavLink
|
|
977
|
-
}), isNotPresent(selectedNavLink) && /*#__PURE__*/React.createElement(Footer, {
|
|
863
|
+
}), /*#__PURE__*/React.createElement(Links, {
|
|
864
|
+
navLinks: navLinks
|
|
865
|
+
}), /*#__PURE__*/React.createElement(Footer, {
|
|
978
866
|
extraTopLinks: extraTopLinks,
|
|
979
867
|
helpLinkOverrides: helpLinkOverrides,
|
|
980
868
|
profileInfoOverrides: profileInfoOverrides,
|