jett.admin.npmpackage 2.0.2 → 2.0.5
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/index.css +9 -0
- package/dist/index.js +77 -13
- package/dist/index.mjs +78 -13
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
monospace;
|
|
24
24
|
--color-red-50: oklch(97.1% 0.013 17.38);
|
|
25
25
|
--color-red-100: oklch(93.6% 0.032 17.717);
|
|
26
|
+
--color-red-400: oklch(70.4% 0.191 22.216);
|
|
26
27
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
27
28
|
--color-red-800: oklch(44.4% 0.177 26.899);
|
|
28
29
|
--color-red-900: oklch(39.6% 0.141 25.723);
|
|
@@ -877,6 +878,9 @@
|
|
|
877
878
|
.text-yellow-800 {
|
|
878
879
|
color: var(--color-yellow-800);
|
|
879
880
|
}
|
|
881
|
+
.opacity-70 {
|
|
882
|
+
opacity: 70%;
|
|
883
|
+
}
|
|
880
884
|
.shadow {
|
|
881
885
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
882
886
|
box-shadow:
|
|
@@ -1230,6 +1234,11 @@
|
|
|
1230
1234
|
background-color: var(--color-yellow-900);
|
|
1231
1235
|
}
|
|
1232
1236
|
}
|
|
1237
|
+
.dark\:\!text-\[\#a1a1aa\] {
|
|
1238
|
+
&:where(.dark, .dark *) {
|
|
1239
|
+
color: #a1a1aa !important;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1233
1242
|
.dark\:text-\[\#71717a\] {
|
|
1234
1243
|
&:where(.dark, .dark *) {
|
|
1235
1244
|
color: #71717a;
|
package/dist/index.js
CHANGED
|
@@ -627,9 +627,6 @@ var additionalItemsConstant = [
|
|
|
627
627
|
}
|
|
628
628
|
];
|
|
629
629
|
|
|
630
|
-
// src/assests/logo/logo-white.svg
|
|
631
|
-
var logo_white_default = "./logo-white-RYMEJOWI.svg";
|
|
632
|
-
|
|
633
630
|
// src/sideBar/SideBar.jsx
|
|
634
631
|
var import_js_cookie = __toESM(require("js-cookie"));
|
|
635
632
|
|
|
@@ -720,6 +717,54 @@ var CustomSelect = ({
|
|
|
720
717
|
);
|
|
721
718
|
};
|
|
722
719
|
|
|
720
|
+
// src/utils/cookieHelpers.js
|
|
721
|
+
var JETT_ID_COOKIE_NAME = "jett-id";
|
|
722
|
+
function getCookie(name) {
|
|
723
|
+
if (typeof document === "undefined" || !document.cookie) return null;
|
|
724
|
+
const match = document.cookie.match(
|
|
725
|
+
new RegExp("(^|\\s)" + name + "=([^;]+)")
|
|
726
|
+
);
|
|
727
|
+
return match ? decodeURIComponent(match[2].trim()) : null;
|
|
728
|
+
}
|
|
729
|
+
function decodeBase64(value) {
|
|
730
|
+
try {
|
|
731
|
+
let base64 = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
732
|
+
const pad = base64.length % 4;
|
|
733
|
+
if (pad) base64 += "=".repeat(4 - pad);
|
|
734
|
+
return atob(base64);
|
|
735
|
+
} catch {
|
|
736
|
+
return "";
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function getJettIdCookieData() {
|
|
740
|
+
const raw = getCookie(JETT_ID_COOKIE_NAME);
|
|
741
|
+
if (!raw) return null;
|
|
742
|
+
try {
|
|
743
|
+
const decoded = decodeBase64(raw);
|
|
744
|
+
if (!decoded) return null;
|
|
745
|
+
const data = JSON.parse(decoded);
|
|
746
|
+
return data && typeof data === "object" ? data : null;
|
|
747
|
+
} catch {
|
|
748
|
+
return null;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
function getLogoFromJettIdCookie() {
|
|
752
|
+
const data = getJettIdCookieData();
|
|
753
|
+
if (!(data == null ? void 0 : data.CDNBasePath)) return null;
|
|
754
|
+
const logoPath = (data.OrgLogo || data.TmcLogo || "").trim();
|
|
755
|
+
if (!logoPath) return null;
|
|
756
|
+
return {
|
|
757
|
+
logoPath,
|
|
758
|
+
CDNBasePath: data.CDNBasePath
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function buildLogoUrl(CDNBasePath, logoPath) {
|
|
762
|
+
const base = (CDNBasePath || "").replace(/\/$/, "");
|
|
763
|
+
const path = (logoPath || "").replace(/^\//, "");
|
|
764
|
+
if (!base || !path) return "";
|
|
765
|
+
return `${base}/${path}`;
|
|
766
|
+
}
|
|
767
|
+
|
|
723
768
|
// src/sideBar/SideBar.jsx
|
|
724
769
|
var AppSideBar = ({
|
|
725
770
|
username,
|
|
@@ -728,7 +773,7 @@ var AppSideBar = ({
|
|
|
728
773
|
additionalItems,
|
|
729
774
|
sideBarLogo
|
|
730
775
|
}) => {
|
|
731
|
-
var _a, _b;
|
|
776
|
+
var _a, _b, _c, _d;
|
|
732
777
|
const [authData, setAuthData] = (0, import_react12.useState)(null);
|
|
733
778
|
const [selectedCountry, setSelectedCountry] = (0, import_react12.useState)("dubai");
|
|
734
779
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = (0, import_react12.useState)(false);
|
|
@@ -881,6 +926,12 @@ var AppSideBar = ({
|
|
|
881
926
|
return true;
|
|
882
927
|
}
|
|
883
928
|
}
|
|
929
|
+
if (normalizedMenuPath === "/supplierdeals" && normalizedCurrentPath === "/orgselector") {
|
|
930
|
+
const currentPathParam = new URLSearchParams(currentSearch).get("path");
|
|
931
|
+
if (currentPathParam === "supplier-deals") {
|
|
932
|
+
return true;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
884
935
|
if (normalizedMenuPath === "/trips") {
|
|
885
936
|
if (normalizedCurrentPath.startsWith("/tripdetails") || normalizedCurrentPath.startsWith("/offline")) {
|
|
886
937
|
return true;
|
|
@@ -941,7 +992,13 @@ var AppSideBar = ({
|
|
|
941
992
|
};
|
|
942
993
|
const navItemsLocal = navItems ?? navItemsConstant;
|
|
943
994
|
const additionalItemsLocal = additionalItems ?? additionalItemsConstant;
|
|
944
|
-
const
|
|
995
|
+
const logoFromCookie = getLogoFromJettIdCookie();
|
|
996
|
+
const logoUrlFromCookie = logoFromCookie ? buildLogoUrl(logoFromCookie.CDNBasePath, logoFromCookie.logoPath) : null;
|
|
997
|
+
const logoUrlFromUserInfo = ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.CDNBasePath) && ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.OrgLogo) ? buildLogoUrl(
|
|
998
|
+
authData.userInfo.CDNBasePath,
|
|
999
|
+
authData.userInfo.OrgLogo
|
|
1000
|
+
) : null;
|
|
1001
|
+
const sideBarLogoLocal = sideBarLogo ?? logoUrlFromCookie ?? logoUrlFromUserInfo ?? null;
|
|
945
1002
|
const detectAndSetActiveMenu = (0, import_react12.useCallback)(() => {
|
|
946
1003
|
const currentPath = window.location.pathname;
|
|
947
1004
|
const currentSearch = window.location.search;
|
|
@@ -1028,10 +1085,10 @@ var AppSideBar = ({
|
|
|
1028
1085
|
"aria-label": "Toggle menu"
|
|
1029
1086
|
},
|
|
1030
1087
|
isMobileMenuOpen ? /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.X, { className: "w-6 h-6 text-gray-700 dark:text-[#f4f4f5cc]" }) : /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.Menu, { className: "w-6 h-6 text-gray-700 dark:text-[#f4f4f5cc]" })
|
|
1031
|
-
), /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex-1 flex justify-center" },
|
|
1088
|
+
), /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex-1 flex justify-center" }, sideBarLogoLocal && /* @__PURE__ */ import_react12.default.createElement(
|
|
1032
1089
|
"img",
|
|
1033
1090
|
{
|
|
1034
|
-
src:
|
|
1091
|
+
src: sideBarLogoLocal,
|
|
1035
1092
|
alt: "sidebarLogo",
|
|
1036
1093
|
width: 108,
|
|
1037
1094
|
height: 40,
|
|
@@ -1048,10 +1105,10 @@ var AppSideBar = ({
|
|
|
1048
1105
|
{
|
|
1049
1106
|
className: `fixed top-0 left-0 md:relative w-[320px] transition-all ease-in-out delay-100 bg-white dark:bg-[#18181b] border-r border-gray-200 dark:border-[#303036] flex flex-col p-4 pt-20 md:pt-4 h-full max-h-[100vh] xs:max-md:z-40 md:max-lg:w-[280px] ${isMobileMenuOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0"}`
|
|
1050
1107
|
},
|
|
1051
|
-
/* @__PURE__ */ import_react12.default.createElement("div", { className: "p-2 mb-2 hidden md:block" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center justify-center w-full h-[60px] mb-2" },
|
|
1108
|
+
/* @__PURE__ */ import_react12.default.createElement("div", { className: "p-2 mb-2 hidden md:block" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center justify-center w-full h-[60px] mb-2" }, sideBarLogoLocal && /* @__PURE__ */ import_react12.default.createElement(
|
|
1052
1109
|
"img",
|
|
1053
1110
|
{
|
|
1054
|
-
src:
|
|
1111
|
+
src: sideBarLogoLocal,
|
|
1055
1112
|
alt: "sidebarLogo",
|
|
1056
1113
|
width: 108,
|
|
1057
1114
|
height: 40,
|
|
@@ -1081,14 +1138,21 @@ var AppSideBar = ({
|
|
|
1081
1138
|
const subMenuKey = `menu-${index}-option-${optionsIndex}`;
|
|
1082
1139
|
const isSubMenuOpen = isMenuOpen(subMenuKey);
|
|
1083
1140
|
const isSubActive = activeMenuPath === subMenuKey || (activeMenuPath == null ? void 0 : activeMenuPath.startsWith(`${subMenuKey}-`));
|
|
1141
|
+
const isDisabled = options.isDisabled;
|
|
1084
1142
|
return /* @__PURE__ */ import_react12.default.createElement("div", { key: optionsIndex, className: "" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
1085
1143
|
"div",
|
|
1086
1144
|
{
|
|
1087
|
-
className: `flex items-center gap-3 py-2 px-3 ml-4 mr-2 hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] text-gray-600 dark:text-[#a1a1aa] cursor-pointer
|
|
1088
|
-
onClick: (e) =>
|
|
1145
|
+
className: `group flex items-center gap-3 py-2 px-3 ml-4 mr-2 rounded-md transition-colors duration-200 ${isDisabled ? "cursor-not-allowed opacity-70 text-gray-400 dark:text-gray-500" : `hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] text-gray-600 dark:text-[#a1a1aa] cursor-pointer ${isSubActive ? "bg-[#f4f4f5] dark:bg-[#27272a]" : ""}`}`,
|
|
1146
|
+
onClick: (e) => {
|
|
1147
|
+
if (isDisabled) {
|
|
1148
|
+
e.preventDefault();
|
|
1149
|
+
return;
|
|
1150
|
+
}
|
|
1151
|
+
handleSubMenuClick(options, optionsIndex, index, e);
|
|
1152
|
+
}
|
|
1089
1153
|
},
|
|
1090
1154
|
/* @__PURE__ */ import_react12.default.createElement("div", null),
|
|
1091
|
-
/* @__PURE__ */ import_react12.default.createElement("span", { className:
|
|
1155
|
+
/* @__PURE__ */ import_react12.default.createElement("span", { className: `!font-medium !text-[15px] ${isDisabled ? "!text-[#3f3f46cc] dark:!text-[#a1a1aa]" : "!text-[#3f3f46cc] dark:!text-[#a1a1aa]"}` }, options.label),
|
|
1092
1156
|
options.isDropDown && /* @__PURE__ */ import_react12.default.createElement(
|
|
1093
1157
|
"div",
|
|
1094
1158
|
{
|
|
@@ -1125,7 +1189,7 @@ var AppSideBar = ({
|
|
|
1125
1189
|
window.location.href = "/profile";
|
|
1126
1190
|
}
|
|
1127
1191
|
},
|
|
1128
|
-
/* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, ((
|
|
1192
|
+
/* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, ((_c = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _c.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("p", { className: "!font-semibold dark:text-white !text-[16px]" }, ((_d = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _d.UserName) ? authData.userInfo.UserName : "Admin"), /* @__PURE__ */ import_react12.default.createElement("p", { className: "!text-[14px] !font-normal dark:text-[#f4f4f5cc]" }, role)))
|
|
1129
1193
|
))
|
|
1130
1194
|
));
|
|
1131
1195
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -393,6 +393,7 @@ var CustomUpload = ({
|
|
|
393
393
|
// src/sideBar/SideBar.jsx
|
|
394
394
|
import {
|
|
395
395
|
ChevronDown as ChevronDown3,
|
|
396
|
+
CircleSlash,
|
|
396
397
|
Globe,
|
|
397
398
|
LogOut,
|
|
398
399
|
Menu,
|
|
@@ -593,9 +594,6 @@ var additionalItemsConstant = [
|
|
|
593
594
|
}
|
|
594
595
|
];
|
|
595
596
|
|
|
596
|
-
// src/assests/logo/logo-white.svg
|
|
597
|
-
var logo_white_default = "./logo-white-RYMEJOWI.svg";
|
|
598
|
-
|
|
599
597
|
// src/sideBar/SideBar.jsx
|
|
600
598
|
import Cookies from "js-cookie";
|
|
601
599
|
|
|
@@ -686,6 +684,54 @@ var CustomSelect = ({
|
|
|
686
684
|
);
|
|
687
685
|
};
|
|
688
686
|
|
|
687
|
+
// src/utils/cookieHelpers.js
|
|
688
|
+
var JETT_ID_COOKIE_NAME = "jett-id";
|
|
689
|
+
function getCookie(name) {
|
|
690
|
+
if (typeof document === "undefined" || !document.cookie) return null;
|
|
691
|
+
const match = document.cookie.match(
|
|
692
|
+
new RegExp("(^|\\s)" + name + "=([^;]+)")
|
|
693
|
+
);
|
|
694
|
+
return match ? decodeURIComponent(match[2].trim()) : null;
|
|
695
|
+
}
|
|
696
|
+
function decodeBase64(value) {
|
|
697
|
+
try {
|
|
698
|
+
let base64 = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
699
|
+
const pad = base64.length % 4;
|
|
700
|
+
if (pad) base64 += "=".repeat(4 - pad);
|
|
701
|
+
return atob(base64);
|
|
702
|
+
} catch {
|
|
703
|
+
return "";
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
function getJettIdCookieData() {
|
|
707
|
+
const raw = getCookie(JETT_ID_COOKIE_NAME);
|
|
708
|
+
if (!raw) return null;
|
|
709
|
+
try {
|
|
710
|
+
const decoded = decodeBase64(raw);
|
|
711
|
+
if (!decoded) return null;
|
|
712
|
+
const data = JSON.parse(decoded);
|
|
713
|
+
return data && typeof data === "object" ? data : null;
|
|
714
|
+
} catch {
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
function getLogoFromJettIdCookie() {
|
|
719
|
+
const data = getJettIdCookieData();
|
|
720
|
+
if (!(data == null ? void 0 : data.CDNBasePath)) return null;
|
|
721
|
+
const logoPath = (data.OrgLogo || data.TmcLogo || "").trim();
|
|
722
|
+
if (!logoPath) return null;
|
|
723
|
+
return {
|
|
724
|
+
logoPath,
|
|
725
|
+
CDNBasePath: data.CDNBasePath
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function buildLogoUrl(CDNBasePath, logoPath) {
|
|
729
|
+
const base = (CDNBasePath || "").replace(/\/$/, "");
|
|
730
|
+
const path = (logoPath || "").replace(/^\//, "");
|
|
731
|
+
if (!base || !path) return "";
|
|
732
|
+
return `${base}/${path}`;
|
|
733
|
+
}
|
|
734
|
+
|
|
689
735
|
// src/sideBar/SideBar.jsx
|
|
690
736
|
var AppSideBar = ({
|
|
691
737
|
username,
|
|
@@ -694,7 +740,7 @@ var AppSideBar = ({
|
|
|
694
740
|
additionalItems,
|
|
695
741
|
sideBarLogo
|
|
696
742
|
}) => {
|
|
697
|
-
var _a, _b;
|
|
743
|
+
var _a, _b, _c, _d;
|
|
698
744
|
const [authData, setAuthData] = useState3(null);
|
|
699
745
|
const [selectedCountry, setSelectedCountry] = useState3("dubai");
|
|
700
746
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState3(false);
|
|
@@ -847,6 +893,12 @@ var AppSideBar = ({
|
|
|
847
893
|
return true;
|
|
848
894
|
}
|
|
849
895
|
}
|
|
896
|
+
if (normalizedMenuPath === "/supplierdeals" && normalizedCurrentPath === "/orgselector") {
|
|
897
|
+
const currentPathParam = new URLSearchParams(currentSearch).get("path");
|
|
898
|
+
if (currentPathParam === "supplier-deals") {
|
|
899
|
+
return true;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
850
902
|
if (normalizedMenuPath === "/trips") {
|
|
851
903
|
if (normalizedCurrentPath.startsWith("/tripdetails") || normalizedCurrentPath.startsWith("/offline")) {
|
|
852
904
|
return true;
|
|
@@ -907,7 +959,13 @@ var AppSideBar = ({
|
|
|
907
959
|
};
|
|
908
960
|
const navItemsLocal = navItems ?? navItemsConstant;
|
|
909
961
|
const additionalItemsLocal = additionalItems ?? additionalItemsConstant;
|
|
910
|
-
const
|
|
962
|
+
const logoFromCookie = getLogoFromJettIdCookie();
|
|
963
|
+
const logoUrlFromCookie = logoFromCookie ? buildLogoUrl(logoFromCookie.CDNBasePath, logoFromCookie.logoPath) : null;
|
|
964
|
+
const logoUrlFromUserInfo = ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.CDNBasePath) && ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.OrgLogo) ? buildLogoUrl(
|
|
965
|
+
authData.userInfo.CDNBasePath,
|
|
966
|
+
authData.userInfo.OrgLogo
|
|
967
|
+
) : null;
|
|
968
|
+
const sideBarLogoLocal = sideBarLogo ?? logoUrlFromCookie ?? logoUrlFromUserInfo ?? null;
|
|
911
969
|
const detectAndSetActiveMenu = useCallback(() => {
|
|
912
970
|
const currentPath = window.location.pathname;
|
|
913
971
|
const currentSearch = window.location.search;
|
|
@@ -994,10 +1052,10 @@ var AppSideBar = ({
|
|
|
994
1052
|
"aria-label": "Toggle menu"
|
|
995
1053
|
},
|
|
996
1054
|
isMobileMenuOpen ? /* @__PURE__ */ React12.createElement(X, { className: "w-6 h-6 text-gray-700 dark:text-[#f4f4f5cc]" }) : /* @__PURE__ */ React12.createElement(Menu, { className: "w-6 h-6 text-gray-700 dark:text-[#f4f4f5cc]" })
|
|
997
|
-
), /* @__PURE__ */ React12.createElement("div", { className: "flex-1 flex justify-center" },
|
|
1055
|
+
), /* @__PURE__ */ React12.createElement("div", { className: "flex-1 flex justify-center" }, sideBarLogoLocal && /* @__PURE__ */ React12.createElement(
|
|
998
1056
|
"img",
|
|
999
1057
|
{
|
|
1000
|
-
src:
|
|
1058
|
+
src: sideBarLogoLocal,
|
|
1001
1059
|
alt: "sidebarLogo",
|
|
1002
1060
|
width: 108,
|
|
1003
1061
|
height: 40,
|
|
@@ -1014,10 +1072,10 @@ var AppSideBar = ({
|
|
|
1014
1072
|
{
|
|
1015
1073
|
className: `fixed top-0 left-0 md:relative w-[320px] transition-all ease-in-out delay-100 bg-white dark:bg-[#18181b] border-r border-gray-200 dark:border-[#303036] flex flex-col p-4 pt-20 md:pt-4 h-full max-h-[100vh] xs:max-md:z-40 md:max-lg:w-[280px] ${isMobileMenuOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0"}`
|
|
1016
1074
|
},
|
|
1017
|
-
/* @__PURE__ */ React12.createElement("div", { className: "p-2 mb-2 hidden md:block" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center w-full h-[60px] mb-2" },
|
|
1075
|
+
/* @__PURE__ */ React12.createElement("div", { className: "p-2 mb-2 hidden md:block" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center w-full h-[60px] mb-2" }, sideBarLogoLocal && /* @__PURE__ */ React12.createElement(
|
|
1018
1076
|
"img",
|
|
1019
1077
|
{
|
|
1020
|
-
src:
|
|
1078
|
+
src: sideBarLogoLocal,
|
|
1021
1079
|
alt: "sidebarLogo",
|
|
1022
1080
|
width: 108,
|
|
1023
1081
|
height: 40,
|
|
@@ -1047,14 +1105,21 @@ var AppSideBar = ({
|
|
|
1047
1105
|
const subMenuKey = `menu-${index}-option-${optionsIndex}`;
|
|
1048
1106
|
const isSubMenuOpen = isMenuOpen(subMenuKey);
|
|
1049
1107
|
const isSubActive = activeMenuPath === subMenuKey || (activeMenuPath == null ? void 0 : activeMenuPath.startsWith(`${subMenuKey}-`));
|
|
1108
|
+
const isDisabled = options.isDisabled;
|
|
1050
1109
|
return /* @__PURE__ */ React12.createElement("div", { key: optionsIndex, className: "" }, /* @__PURE__ */ React12.createElement(
|
|
1051
1110
|
"div",
|
|
1052
1111
|
{
|
|
1053
|
-
className: `flex items-center gap-3 py-2 px-3 ml-4 mr-2 hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] text-gray-600 dark:text-[#a1a1aa] cursor-pointer
|
|
1054
|
-
onClick: (e) =>
|
|
1112
|
+
className: `group flex items-center gap-3 py-2 px-3 ml-4 mr-2 rounded-md transition-colors duration-200 ${isDisabled ? "cursor-not-allowed opacity-70 text-gray-400 dark:text-gray-500" : `hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] text-gray-600 dark:text-[#a1a1aa] cursor-pointer ${isSubActive ? "bg-[#f4f4f5] dark:bg-[#27272a]" : ""}`}`,
|
|
1113
|
+
onClick: (e) => {
|
|
1114
|
+
if (isDisabled) {
|
|
1115
|
+
e.preventDefault();
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
handleSubMenuClick(options, optionsIndex, index, e);
|
|
1119
|
+
}
|
|
1055
1120
|
},
|
|
1056
1121
|
/* @__PURE__ */ React12.createElement("div", null),
|
|
1057
|
-
/* @__PURE__ */ React12.createElement("span", { className:
|
|
1122
|
+
/* @__PURE__ */ React12.createElement("span", { className: `!font-medium !text-[15px] ${isDisabled ? "!text-[#3f3f46cc] dark:!text-[#a1a1aa]" : "!text-[#3f3f46cc] dark:!text-[#a1a1aa]"}` }, options.label),
|
|
1058
1123
|
options.isDropDown && /* @__PURE__ */ React12.createElement(
|
|
1059
1124
|
"div",
|
|
1060
1125
|
{
|
|
@@ -1091,7 +1156,7 @@ var AppSideBar = ({
|
|
|
1091
1156
|
window.location.href = "/profile";
|
|
1092
1157
|
}
|
|
1093
1158
|
},
|
|
1094
|
-
/* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React12.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ React12.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, ((
|
|
1159
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React12.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ React12.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, ((_c = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _c.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("p", { className: "!font-semibold dark:text-white !text-[16px]" }, ((_d = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _d.UserName) ? authData.userInfo.UserName : "Admin"), /* @__PURE__ */ React12.createElement("p", { className: "!text-[14px] !font-normal dark:text-[#f4f4f5cc]" }, role)))
|
|
1095
1160
|
))
|
|
1096
1161
|
));
|
|
1097
1162
|
};
|