@etsoo/smarterp-core 1.0.28 → 1.0.30

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.
@@ -6,11 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AppSwitchPopover = AppSwitchPopover;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = __importDefault(require("react"));
9
- const material_1 = require("@mui/material");
10
9
  const react_router_dom_1 = require("react-router-dom");
11
10
  const materialui_1 = require("@etsoo/materialui");
12
11
  const ICoreServiceApp_1 = require("../../ICoreServiceApp");
13
12
  const appscript_1 = require("@etsoo/appscript");
13
+ const Typography_1 = __importDefault(require("@mui/material/Typography"));
14
+ const Stack_1 = __importDefault(require("@mui/material/Stack"));
15
+ const Button_1 = __importDefault(require("@mui/material/Button"));
14
16
  function AppSwitchPopover(props) {
15
17
  // Destruct
16
18
  const { appName } = props;
@@ -25,7 +27,7 @@ function AppSwitchPopover(props) {
25
27
  // Current app
26
28
  const currentApp = app.settings.appId;
27
29
  // Layout
28
- return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopover, { button: (callback) => ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", sx: {
30
+ return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopover, { button: (callback) => ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h6", sx: {
29
31
  color: (theme) => theme.palette.primary.main,
30
32
  fontWeight: "700",
31
33
  ml: 0.5,
@@ -38,7 +40,7 @@ function AppSwitchPopover(props) {
38
40
  const index = data.findIndex((a) => a.id === currentApp);
39
41
  if (index >= 0)
40
42
  data.splice(index, 1);
41
- return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "column", margin: 2, children: [data.map((appData) => ((0, jsx_runtime_1.jsx)(material_1.Button, { onClick: async () => {
43
+ return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", margin: 2, children: [data.map((appData) => ((0, jsx_runtime_1.jsx)(Button_1.default, { onClick: async () => {
42
44
  /*
43
45
  // Method 1, get the login URL and redirect
44
46
  const tasks = appData.urls.map((u) =>
@@ -73,6 +75,6 @@ function AppSwitchPopover(props) {
73
75
  }
74
76
  }
75
77
  app.notifier.alert(app.get("networkFailure"));
76
- }, children: app.core.getAppName(appData) }, appData.id))), (data.length === 0 || data.length === maxItems) && ((0, jsx_runtime_1.jsxs)(material_1.Button, { onClick: () => navigate("./app/my"), children: [labels.more, "..."] }))] }));
78
+ }, children: app.core.getAppName(appData) }, appData.id))), (data.length === 0 || data.length === maxItems) && ((0, jsx_runtime_1.jsxs)(Button_1.default, { onClick: () => navigate("./app/my"), children: [labels.more, "..."] }))] }));
77
79
  } }));
78
80
  }
@@ -6,11 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.OrgSwitchPopover = OrgSwitchPopover;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = __importDefault(require("react"));
9
- const material_1 = require("@mui/material");
10
9
  const AccountTree_1 = __importDefault(require("@mui/icons-material/AccountTree"));
11
10
  const react_router_dom_1 = require("react-router-dom");
12
11
  const materialui_1 = require("@etsoo/materialui");
13
12
  const ICoreServiceApp_1 = require("../../ICoreServiceApp");
13
+ const ButtonGroup_1 = __importDefault(require("@mui/material/ButtonGroup"));
14
+ const Button_1 = __importDefault(require("@mui/material/Button"));
15
+ const Stack_1 = __importDefault(require("@mui/material/Stack"));
14
16
  function OrgSwitchPopover(props) {
15
17
  // Destruct
16
18
  const { organizationName } = props;
@@ -27,7 +29,7 @@ function OrgSwitchPopover(props) {
27
29
  // Current organization
28
30
  const currentOrg = app.userData?.organization;
29
31
  // Layout
30
- return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopover, { button: (callback) => ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.ButtonGroup, { variant: "text", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), (0, jsx_runtime_1.jsx)(material_1.Button, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: (0, jsx_runtime_1.jsx)(AccountTree_1.default, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ maxItems }, { showLoading: false }), children: (data) => {
32
+ return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopover, { button: (callback) => ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(ButtonGroup_1.default, { variant: "text", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), (0, jsx_runtime_1.jsx)(Button_1.default, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: (0, jsx_runtime_1.jsx)(AccountTree_1.default, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ maxItems }, { showLoading: false }), children: (data) => {
31
33
  if (data == null)
32
34
  return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {});
33
35
  // Remove the current organization
@@ -36,7 +38,7 @@ function OrgSwitchPopover(props) {
36
38
  if (index >= 0)
37
39
  data.splice(index, 1);
38
40
  }
39
- return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "column", margin: 2, children: [data.map((org) => ((0, jsx_runtime_1.jsx)(material_1.Button, { onClick: async () => {
41
+ return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", margin: 2, children: [data.map((org) => ((0, jsx_runtime_1.jsx)(Button_1.default, { onClick: async () => {
40
42
  const result = await app.switchOrg(org.id);
41
43
  if (result == null)
42
44
  return;
@@ -44,6 +46,6 @@ function OrgSwitchPopover(props) {
44
46
  app.alertResult(result);
45
47
  return;
46
48
  }
47
- }, children: org.name }, org.id))), (data.length === 0 || data.length === maxItems) && ((0, jsx_runtime_1.jsxs)(material_1.Button, { onClick: () => navigate("./org/my"), children: [labels.more, "..."] }))] }));
49
+ }, children: org.name }, org.id))), (data.length === 0 || data.length === maxItems) && ((0, jsx_runtime_1.jsxs)(Button_1.default, { onClick: () => navigate("./org/my"), children: [labels.more, "..."] }))] }));
48
50
  } }));
49
51
  }
@@ -1,10 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { Button, Stack, Typography } from "@mui/material";
4
3
  import { useNavigate } from "react-router-dom";
5
4
  import { ButtonPopover } from "@etsoo/materialui";
6
5
  import { useRequiredAppContext } from "../../ICoreServiceApp";
7
6
  import { IdentityType } from "@etsoo/appscript";
7
+ import Typography from "@mui/material/Typography";
8
+ import Stack from "@mui/material/Stack";
9
+ import Button from "@mui/material/Button";
8
10
  export function AppSwitchPopover(props) {
9
11
  // Destruct
10
12
  const { appName } = props;
@@ -1,10 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { Button, ButtonGroup, Stack } from "@mui/material";
4
3
  import AccountTreeIcon from "@mui/icons-material/AccountTree";
5
4
  import { useNavigate } from "react-router-dom";
6
5
  import { ButtonPopover } from "@etsoo/materialui";
7
6
  import { useRequiredAppContext } from "../../ICoreServiceApp";
7
+ import ButtonGroup from "@mui/material/ButtonGroup";
8
+ import Button from "@mui/material/Button";
9
+ import Stack from "@mui/material/Stack";
8
10
  export function OrgSwitchPopover(props) {
9
11
  // Destruct
10
12
  const { organizationName } = props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -40,12 +40,12 @@
40
40
  "license": "MIT",
41
41
  "homepage": "https://github.com/ETSOO/etsoo-smarterp-core#readme",
42
42
  "devDependencies": {
43
- "@babel/cli": "^7.26.4",
43
+ "@babel/cli": "^7.27.0",
44
44
  "@babel/core": "^7.26.10",
45
45
  "@babel/plugin-transform-runtime": "^7.26.10",
46
46
  "@babel/preset-env": "^7.26.9",
47
- "@babel/runtime-corejs3": "^7.26.10",
48
- "@types/react": "^18.3.19",
47
+ "@babel/runtime-corejs3": "^7.27.0",
48
+ "@types/react": "^18.3.20",
49
49
  "@types/react-dom": "^18.3.1",
50
50
  "@vitejs/plugin-react": "^4.3.4",
51
51
  "jsdom": "^26.0.0",
@@ -53,12 +53,12 @@
53
53
  "vitest": "^3.0.9"
54
54
  },
55
55
  "dependencies": {
56
- "@etsoo/appscript": "^1.6.19",
57
- "@etsoo/materialui": "^1.5.2",
58
- "@etsoo/react": "^1.8.33",
56
+ "@etsoo/appscript": "^1.6.20",
57
+ "@etsoo/materialui": "^1.5.3",
58
+ "@etsoo/react": "^1.8.34",
59
59
  "@etsoo/shared": "^1.2.63",
60
- "@etsoo/toolpad": "^1.0.21",
61
- "@mui/material": "^6.4.8",
60
+ "@etsoo/toolpad": "^1.0.23",
61
+ "@mui/material": "^7.0.0",
62
62
  "react": "^18.3.1",
63
63
  "react-dom": "^18.3.1"
64
64
  }
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
- import { Button, Stack, Typography } from "@mui/material";
3
2
  import { useNavigate } from "react-router-dom";
4
3
  import { ButtonPopover } from "@etsoo/materialui";
5
4
  import { useRequiredAppContext } from "../../ICoreServiceApp";
6
5
  import { AppData } from "../../dto/app/AppData";
7
6
  import { AuthRequest, IdentityType } from "@etsoo/appscript";
7
+ import Typography from "@mui/material/Typography";
8
+ import Stack from "@mui/material/Stack";
9
+ import Button from "@mui/material/Button";
8
10
 
9
11
  export type AppSwitchPopoverProps = {
10
12
  appName: string;
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
- import { Button, ButtonGroup, Stack } from "@mui/material";
3
2
  import AccountTreeIcon from "@mui/icons-material/AccountTree";
4
3
  import { useNavigate } from "react-router-dom";
5
4
  import { ButtonPopover } from "@etsoo/materialui";
6
5
  import { OrgGetMyData } from "../../dto/org/OrgGetMyData";
7
6
  import { useRequiredAppContext } from "../../ICoreServiceApp";
7
+ import ButtonGroup from "@mui/material/ButtonGroup";
8
+ import Button from "@mui/material/Button";
9
+ import Stack from "@mui/material/Stack";
8
10
 
9
11
  export type OrgSwitchPopoverProps = {
10
12
  organizationName?: string;