@etsoo/materialui 1.1.14 → 1.1.15

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.
@@ -8,7 +8,7 @@ export interface LeftDrawerMethods {
8
8
  /**
9
9
  * Left drawer props
10
10
  */
11
- export interface LeftDrawerProps {
11
+ export type LeftDrawerProps = React.PropsWithRef<{
12
12
  /**
13
13
  * Show when md up
14
14
  */
@@ -24,12 +24,33 @@ export interface LeftDrawerProps {
24
24
  /**
25
25
  * Application name
26
26
  */
27
- appName: string;
27
+ appName?: string;
28
28
  /**
29
29
  * Minimize hanlder
30
30
  */
31
31
  onMinimize?: () => void;
32
- }
33
- export declare const LeftDrawer: React.ForwardRefExoticComponent<LeftDrawerProps & {
32
+ }>;
33
+ export declare const LeftDrawer: React.ForwardRefExoticComponent<{
34
+ /**
35
+ * Show when md up
36
+ */
37
+ mdUp: boolean;
38
+ /**
39
+ * Organization
40
+ */
41
+ organization?: number | undefined;
42
+ /**
43
+ * Width
44
+ */
45
+ width: number;
46
+ /**
47
+ * Application name
48
+ */
49
+ appName?: string | undefined;
50
+ /**
51
+ * Minimize hanlder
52
+ */
53
+ onMinimize?: (() => void) | undefined;
54
+ } & {
34
55
  children?: React.ReactNode;
35
56
  } & React.RefAttributes<LeftDrawerMethods>>;
@@ -6,7 +6,7 @@ import { globalApp } from "../app/ReactApp";
6
6
  export const LeftDrawer = React.forwardRef((props, ref) => {
7
7
  var _a;
8
8
  // Destruct
9
- const { mdUp, width, appName, onMinimize, children } = props;
9
+ const { mdUp, width, appName = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get("appName"), onMinimize, children } = props;
10
10
  // Menu open/close state
11
11
  const [open, setOpen] = React.useState();
12
12
  const handleDrawerClose = () => {
@@ -36,7 +36,7 @@ export const LeftDrawer = React.forwardRef((props, ref) => {
36
36
  React.createElement(DrawerHeader, null,
37
37
  React.createElement("a", { href: "https://www.etsoo.com", title: (_a = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get("etsoo")) !== null && _a !== void 0 ? _a : "ETSOO", target: "_blank", rel: "noreferrer" },
38
38
  React.createElement(Avatar, { src: process.env.PUBLIC_URL + "/logo192.png", variant: "square", sx: { marginLeft: -0.5, marginRight: 1.5, marginBottom: 1 } })),
39
- React.createElement(Typography, { noWrap: true, component: "div", title: appName }, appName),
39
+ React.createElement(Typography, { noWrap: true, component: "div", title: appName, sx: { flexGrow: 2 } }, appName),
40
40
  React.createElement(IconButton, { size: "small", onClick: handleDrawerClose },
41
41
  React.createElement(ChevronLeftIcon, null))),
42
42
  React.createElement(Divider, null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -6,7 +6,7 @@ import {
6
6
  List,
7
7
  Typography
8
8
  } from "@mui/material";
9
- import React, { PropsWithChildren } from "react";
9
+ import React from "react";
10
10
  import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
11
11
  import { DrawerHeader } from "./DrawerHeader";
12
12
  import { globalApp } from "../app/ReactApp";
@@ -21,7 +21,7 @@ export interface LeftDrawerMethods {
21
21
  /**
22
22
  * Left drawer props
23
23
  */
24
- export interface LeftDrawerProps {
24
+ export type LeftDrawerProps = React.PropsWithRef<{
25
25
  /**
26
26
  * Show when md up
27
27
  */
@@ -40,20 +40,26 @@ export interface LeftDrawerProps {
40
40
  /**
41
41
  * Application name
42
42
  */
43
- appName: string;
43
+ appName?: string;
44
44
 
45
45
  /**
46
46
  * Minimize hanlder
47
47
  */
48
48
  onMinimize?: () => void;
49
- }
49
+ }>;
50
50
 
51
51
  export const LeftDrawer = React.forwardRef<
52
52
  LeftDrawerMethods,
53
- PropsWithChildren<LeftDrawerProps>
53
+ React.PropsWithChildren<LeftDrawerProps>
54
54
  >((props, ref) => {
55
55
  // Destruct
56
- const { mdUp, width, appName, onMinimize, children } = props;
56
+ const {
57
+ mdUp,
58
+ width,
59
+ appName = globalApp?.get("appName"),
60
+ onMinimize,
61
+ children
62
+ } = props;
57
63
 
58
64
  // Menu open/close state
59
65
  const [open, setOpen] = React.useState<boolean>();
@@ -105,7 +111,7 @@ export const LeftDrawer = React.forwardRef<
105
111
  sx={{ marginLeft: -0.5, marginRight: 1.5, marginBottom: 1 }}
106
112
  />
107
113
  </a>
108
- <Typography noWrap component="div" title={appName}>
114
+ <Typography noWrap component="div" title={appName} sx={{ flexGrow: 2 }}>
109
115
  {appName}
110
116
  </Typography>
111
117
  <IconButton size="small" onClick={handleDrawerClose}>