@danikokonn/yarik-frontend-lib 2.0.49-test5 → 2.0.49-test7

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.
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import NavigationProps from "./NavigationProps";
3
- export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, }: NavigationProps): React.JSX.Element;
3
+ export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, activeTab, withReactRouter, }: NavigationProps): React.JSX.Element;
4
4
  //# sourceMappingURL=Navigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AA4BzC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,UAAU,GACX,EAAE,eAAe,qBAmVjB"}
1
+ {"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AA4BzC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,eAAe,GAChB,EAAE,eAAe,qBAyVjB"}
@@ -22,7 +22,7 @@ import ListItemText from "@mui/material/ListItemText";
22
22
  import { Button, useColorScheme, useMediaQuery } from "@mui/material";
23
23
  import { popoverClasses } from "@mui/material/Popover";
24
24
  import NavMenu from "./NavMenu";
25
- export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, }) {
25
+ export default function Navigation({ additionalControls, username, title, navLinks, logoutPageUrl, defautlUrl, appsUrl, profileUrl, activeTab, withReactRouter, }) {
26
26
  const locationRouter = useLocation();
27
27
  const { mode, setMode } = useColorScheme();
28
28
  const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
@@ -41,10 +41,11 @@ export default function Navigation({ additionalControls, username, title, navLin
41
41
  const getPages = (sx, anchorOrigin, transformOrigin, endIcon) => {
42
42
  return navLinks.map((lnk, idx) => {
43
43
  if ("groupName" in lnk) {
44
- return (React.createElement(NavMenu, { key: idx, name: lnk.groupName, routes: lnk.links, activeTab: locationRouter.pathname, sx: sx, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, endIcon: endIcon }));
44
+ return (React.createElement(NavMenu, { key: idx, name: lnk.groupName, routes: lnk.links, activeTab: withReactRouter ? locationRouter.pathname : activeTab || "", sx: sx, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, endIcon: endIcon }));
45
45
  }
46
46
  else {
47
- return (React.createElement(Button, { component: RouterLink, to: lnk.url, key: idx, sx: sx, color: "inherit", variant: "text", disabled: lnk.url === locationRouter.pathname }, lnk.name));
47
+ return (React.createElement(Button, { component: withReactRouter ? RouterLink : "button", disabled: lnk.url ===
48
+ (withReactRouter ? locationRouter.pathname : activeTab), to: withReactRouter ? lnk.url : undefined, href: withReactRouter ? undefined : lnk.url, key: idx, sx: sx, color: "inherit", variant: "text" }, lnk.name));
48
49
  }
49
50
  });
50
51
  };
@@ -13,6 +13,8 @@ interface Link {
13
13
  targetBlank?: boolean;
14
14
  }
15
15
  export default interface NavigationProps {
16
+ withReactRouter?: boolean;
17
+ activeTab?: string;
16
18
  username: string;
17
19
  appsUrl?: string;
18
20
  profileUrl?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationProps.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/NavigationProps.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,KAAK,EACH,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,GACT,OAAO,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EACH,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,aAAa,GACb,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;IACR,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CACN;QACA,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,IAAI,EAAE,CAAC;KACf,GACC,IAAI,CACP,EAAE,CAAC;CACL"}
1
+ {"version":3,"file":"NavigationProps.d.ts","sourceRoot":"","sources":["../../../src/components/Navigation/NavigationProps.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,KAAK,EACD,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,GACT,OAAO,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EACD,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,aAAa,GACb,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;IACV,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CACN;QACE,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,IAAI,EAAE,CAAC;KACf,GACD,IAAI,CACP,EAAE,CAAC;CACL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danikokonn/yarik-frontend-lib",
3
- "version": "2.0.49-test5",
3
+ "version": "2.0.49-test7",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "author": "",