sevago-sso-fe 1.0.12 → 1.0.13

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.cjs.js CHANGED
@@ -21262,8 +21262,32 @@ const MonitorPart = ({
21262
21262
  const DashboardLayout = ({
21263
21263
  children
21264
21264
  }) => {
21265
- useUpdateCurrentAccess();
21266
- return /* @__PURE__ */ jsxRuntime.jsx(MonitorPart, { children });
21265
+ const isSystemMonitor = useIsSystemMonitor();
21266
+ const { sidebarWidth } = useSidebar();
21267
+ if (isSystemMonitor) return /* @__PURE__ */ jsxRuntime.jsx(MonitorPart, { children });
21268
+ return /* @__PURE__ */ jsxRuntime.jsx(
21269
+ material.Stack,
21270
+ {
21271
+ sx: {
21272
+ minHeight: "100vh",
21273
+ width: "100%"
21274
+ },
21275
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.Stack, { p: 0, gap: 0, children: /* @__PURE__ */ jsxRuntime.jsx(StackRow, { children: /* @__PURE__ */ jsxRuntime.jsx(
21276
+ material.Stack,
21277
+ {
21278
+ sx: {
21279
+ overflowY: "auto",
21280
+ marginLeft: sidebarWidth,
21281
+ width: "100%",
21282
+ transition: "margin-left 0.3s ease",
21283
+ background: "#F5F6F8",
21284
+ minHeight: `calc(100vh - ${STYLE.HEIGHT_HEADER}px)`
21285
+ },
21286
+ children
21287
+ }
21288
+ ) }) })
21289
+ }
21290
+ );
21267
21291
  };
21268
21292
  const DefaultLayout = ({ children }) => {
21269
21293
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -33515,7 +33539,7 @@ const MotionBox = ({
33515
33539
  } : {};
33516
33540
  return /* @__PURE__ */ jsxRuntime.jsx(motion.div, { ...motionProps, ...getAnimationProps(), ...hoverProps, onClick, style: { ...sx }, children });
33517
33541
  };
33518
- const IconRight = (props) => /* @__PURE__ */ jsxRuntime.jsx(
33542
+ const IconLeft = (props) => /* @__PURE__ */ jsxRuntime.jsx(
33519
33543
  "svg",
33520
33544
  {
33521
33545
  width: "20",
@@ -33527,7 +33551,7 @@ const IconRight = (props) => /* @__PURE__ */ jsxRuntime.jsx(
33527
33551
  children: /* @__PURE__ */ jsxRuntime.jsx(
33528
33552
  "path",
33529
33553
  {
33530
- d: "M12 1L19 8M19 8L12 15M19 8L1 8",
33554
+ d: "M8 15L1 8M1 8L8 1M1 8L19 8",
33531
33555
  stroke: "currentColor",
33532
33556
  "stroke-width": "2",
33533
33557
  "stroke-linecap": "round",
@@ -33536,7 +33560,7 @@ const IconRight = (props) => /* @__PURE__ */ jsxRuntime.jsx(
33536
33560
  )
33537
33561
  }
33538
33562
  );
33539
- const IconLeft = (props) => /* @__PURE__ */ jsxRuntime.jsx(
33563
+ const IconRight = (props) => /* @__PURE__ */ jsxRuntime.jsx(
33540
33564
  "svg",
33541
33565
  {
33542
33566
  width: "20",
@@ -33548,7 +33572,7 @@ const IconLeft = (props) => /* @__PURE__ */ jsxRuntime.jsx(
33548
33572
  children: /* @__PURE__ */ jsxRuntime.jsx(
33549
33573
  "path",
33550
33574
  {
33551
- d: "M8 15L1 8M1 8L8 1M1 8L19 8",
33575
+ d: "M12 1L19 8M19 8L12 15M19 8L1 8",
33552
33576
  stroke: "currentColor",
33553
33577
  "stroke-width": "2",
33554
33578
  "stroke-linecap": "round",
@@ -33577,12 +33601,25 @@ const AppGrid = ({
33577
33601
  const pageSize = Math.max(1, columns * Math.max(1, rows));
33578
33602
  const totalPages = Math.max(1, Math.ceil(apps.length / pageSize));
33579
33603
  const [page, setPage] = React.useState(0);
33604
+ const { user } = reactRedux.useSelector((state) => state.account);
33580
33605
  React.useEffect(() => {
33581
33606
  setPage((prev) => prev >= totalPages ? totalPages - 1 : prev);
33582
33607
  }, [totalPages, columns, rows, apps.length]);
33583
33608
  const start = page * pageSize;
33584
33609
  const end = start + pageSize;
33585
33610
  const visibleApps = totalPages > 1 ? apps.slice(start, end) : apps;
33611
+ const findLink = (app2) => {
33612
+ if (!app2.children?.length) {
33613
+ return app2.path;
33614
+ }
33615
+ for (const i of app2.children || []) {
33616
+ if (user?.type && i.allowUserTypes.includes(user?.type)) {
33617
+ if (i.path) {
33618
+ return `${i.path}`;
33619
+ }
33620
+ }
33621
+ }
33622
+ };
33586
33623
  return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { position: "relative" }, children: [
33587
33624
  /* @__PURE__ */ jsxRuntime.jsx(
33588
33625
  material.Box,
@@ -33594,62 +33631,73 @@ const AppGrid = ({
33594
33631
  },
33595
33632
  children: visibleApps.map((app2, index) => {
33596
33633
  const isSelected = selectedAppId === app2.key;
33597
- return /* @__PURE__ */ jsxRuntime.jsxs(
33598
- MotionBox,
33634
+ return /* @__PURE__ */ jsxRuntime.jsx(
33635
+ reactRouterDom.Link,
33599
33636
  {
33600
- preset: "staggerItem",
33601
- index,
33602
- hover: true,
33603
- onClick: () => onClickItem?.(app2),
33604
- sx: {
33605
- cursor: "pointer",
33606
- display: "flex",
33607
- flex: 1,
33608
- alignItems: "center",
33609
- flexDirection: "column"
33637
+ to: findLink(app2) || "#",
33638
+ style: {
33639
+ textDecoration: "none",
33640
+ color: "inherit",
33641
+ width: "100%"
33610
33642
  },
33611
- children: [
33612
- /* @__PURE__ */ jsxRuntime.jsx(
33613
- material.Box,
33614
- {
33615
- sx: {
33616
- width: iconSize,
33617
- height: iconSize,
33618
- borderRadius: iconRadius,
33619
- mb: 1.5,
33620
- display: "flex",
33621
- alignItems: "center",
33622
- justifyContent: "center",
33623
- background: getAppColor(app2.category),
33624
- boxShadow: isSelected ? `0 0 0 1px ${theme.palette.primary.main}, ${iconShadow}` : iconShadow
33625
- },
33626
- children: app2.icon.startsWith("/") && /* @__PURE__ */ jsxRuntime.jsx(
33627
- ImageElement,
33643
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
33644
+ MotionBox,
33645
+ {
33646
+ preset: "staggerItem",
33647
+ index,
33648
+ hover: true,
33649
+ onClick: () => onClickItem?.(app2),
33650
+ sx: {
33651
+ cursor: "pointer",
33652
+ display: "flex",
33653
+ flex: 1,
33654
+ alignItems: "center",
33655
+ flexDirection: "column"
33656
+ },
33657
+ children: [
33658
+ /* @__PURE__ */ jsxRuntime.jsx(
33659
+ material.Box,
33628
33660
  {
33629
- sx: { width: iconSize * 0.56, height: iconSize * 0.56 },
33630
- url: app2.icon,
33631
- sizeType: ImageSizeType.SQUARE
33661
+ sx: {
33662
+ width: iconSize,
33663
+ height: iconSize,
33664
+ borderRadius: iconRadius,
33665
+ mb: 1.5,
33666
+ display: "flex",
33667
+ alignItems: "center",
33668
+ justifyContent: "center",
33669
+ background: getAppColor(app2.category),
33670
+ boxShadow: isSelected ? `0 0 0 1px ${theme.palette.primary.main}, ${iconShadow}` : iconShadow
33671
+ },
33672
+ children: app2.icon.startsWith("/") && /* @__PURE__ */ jsxRuntime.jsx(
33673
+ ImageElement,
33674
+ {
33675
+ sx: { width: iconSize * 0.56, height: iconSize * 0.56 },
33676
+ url: app2.icon,
33677
+ sizeType: ImageSizeType.SQUARE
33678
+ }
33679
+ )
33680
+ }
33681
+ ),
33682
+ /* @__PURE__ */ jsxRuntime.jsx(
33683
+ material.Typography,
33684
+ {
33685
+ variant: titleVariant,
33686
+ sx: { color: titleColor ?? theme.palette.common.white },
33687
+ children: app2.title
33688
+ }
33689
+ ),
33690
+ /* @__PURE__ */ jsxRuntime.jsx(
33691
+ material.Typography,
33692
+ {
33693
+ variant: captionVariant,
33694
+ sx: { color: captionColor ?? theme.palette.common.white },
33695
+ children: app2.caption
33632
33696
  }
33633
33697
  )
33634
- }
33635
- ),
33636
- /* @__PURE__ */ jsxRuntime.jsx(
33637
- material.Typography,
33638
- {
33639
- variant: titleVariant,
33640
- sx: { color: titleColor ?? theme.palette.common.white },
33641
- children: app2.title
33642
- }
33643
- ),
33644
- /* @__PURE__ */ jsxRuntime.jsx(
33645
- material.Typography,
33646
- {
33647
- variant: captionVariant,
33648
- sx: { color: captionColor ?? theme.palette.common.white },
33649
- children: app2.caption
33650
- }
33651
- )
33652
- ]
33698
+ ]
33699
+ }
33700
+ )
33653
33701
  },
33654
33702
  app2.key
33655
33703
  );