@etsoo/smarterp-core 1.0.63 → 1.0.65
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/lib/cjs/components/app/IdentityFlagsList.d.ts +4 -1
- package/lib/cjs/components/app/IdentityFlagsList.js +3 -3
- package/lib/cjs/components/org/OrgSwitchPopover.d.ts +1 -0
- package/lib/cjs/components/org/OrgSwitchPopover.js +2 -2
- package/lib/cjs/i18n/en.json +1 -0
- package/lib/cjs/i18n/zh-Hans.json +1 -0
- package/lib/cjs/i18n/zh-Hant.json +1 -0
- package/lib/cjs/rq/org/OrgGetMyRQ.d.ts +5 -0
- package/lib/mjs/components/app/IdentityFlagsList.d.ts +4 -1
- package/lib/mjs/components/app/IdentityFlagsList.js +3 -3
- package/lib/mjs/components/org/OrgSwitchPopover.d.ts +1 -0
- package/lib/mjs/components/org/OrgSwitchPopover.js +2 -2
- package/lib/mjs/i18n/en.json +1 -0
- package/lib/mjs/i18n/zh-Hans.json +1 -0
- package/lib/mjs/i18n/zh-Hant.json +1 -0
- package/lib/mjs/rq/org/OrgGetMyRQ.d.ts +5 -0
- package/package.json +9 -9
- package/src/components/app/IdentityFlagsList.tsx +8 -4
- package/src/components/org/OrgSwitchPopover.tsx +3 -2
- package/src/i18n/en.json +1 -0
- package/src/i18n/zh-Hans.json +1 -0
- package/src/i18n/zh-Hant.json +1 -0
- package/src/rq/org/OrgGetMyRQ.ts +6 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { SelectExProps } from "@etsoo/materialui";
|
|
2
2
|
import { ListType } from "@etsoo/shared";
|
|
3
|
+
import { IdentityTypeFlags } from "@etsoo/appscript";
|
|
3
4
|
/**
|
|
4
5
|
* Identity flags list component
|
|
5
6
|
* @param props Props
|
|
6
7
|
* @returns Component
|
|
7
8
|
*/
|
|
8
|
-
export declare function IdentityFlagsList(props: Omit<SelectExProps<ListType>, "options">
|
|
9
|
+
export declare function IdentityFlagsList(props: Omit<SelectExProps<ListType>, "options"> & {
|
|
10
|
+
baseIdentity?: IdentityTypeFlags;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,10 +12,10 @@ const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
|
12
12
|
function IdentityFlagsList(props) {
|
|
13
13
|
// App
|
|
14
14
|
const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
|
|
15
|
-
// Identities
|
|
16
|
-
const identities = app.core.getIdentityFlags();
|
|
17
15
|
// Destruct
|
|
18
|
-
const { label = app.get("identityType"), name = "identityType", ...rest } = props;
|
|
16
|
+
const { baseIdentity, label = app.get("identityType"), name = "identityType", ...rest } = props;
|
|
17
|
+
// Identities
|
|
18
|
+
const identities = app.core.getIdentityFlags(baseIdentity);
|
|
19
19
|
// Layout
|
|
20
20
|
return (0, jsx_runtime_1.jsx)(materialui_1.SelectEx, { label: label, name: name, options: identities, ...rest });
|
|
21
21
|
}
|
|
@@ -15,7 +15,7 @@ const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
|
15
15
|
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
16
16
|
function OrgSwitchPopover(props) {
|
|
17
17
|
// Destruct
|
|
18
|
-
const { organizationName } = props;
|
|
18
|
+
const { appId, organizationName } = props;
|
|
19
19
|
// Route
|
|
20
20
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
21
21
|
// App
|
|
@@ -29,7 +29,7 @@ function OrgSwitchPopover(props) {
|
|
|
29
29
|
// Current organization
|
|
30
30
|
const currentOrg = app.userData?.organization;
|
|
31
31
|
// Layout
|
|
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) => {
|
|
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({ appId, maxItems }, { showLoading: false }), children: (data) => {
|
|
33
33
|
if (data == null)
|
|
34
34
|
return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {});
|
|
35
35
|
// Remove the current organization
|
package/lib/cjs/i18n/en.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { SelectExProps } from "@etsoo/materialui";
|
|
2
2
|
import { ListType } from "@etsoo/shared";
|
|
3
|
+
import { IdentityTypeFlags } from "@etsoo/appscript";
|
|
3
4
|
/**
|
|
4
5
|
* Identity flags list component
|
|
5
6
|
* @param props Props
|
|
6
7
|
* @returns Component
|
|
7
8
|
*/
|
|
8
|
-
export declare function IdentityFlagsList(props: Omit<SelectExProps<ListType>, "options">
|
|
9
|
+
export declare function IdentityFlagsList(props: Omit<SelectExProps<ListType>, "options"> & {
|
|
10
|
+
baseIdentity?: IdentityTypeFlags;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,10 +9,10 @@ import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
|
9
9
|
export function IdentityFlagsList(props) {
|
|
10
10
|
// App
|
|
11
11
|
const app = useRequiredAppContext();
|
|
12
|
-
// Identities
|
|
13
|
-
const identities = app.core.getIdentityFlags();
|
|
14
12
|
// Destruct
|
|
15
|
-
const { label = app.get("identityType"), name = "identityType", ...rest } = props;
|
|
13
|
+
const { baseIdentity, label = app.get("identityType"), name = "identityType", ...rest } = props;
|
|
14
|
+
// Identities
|
|
15
|
+
const identities = app.core.getIdentityFlags(baseIdentity);
|
|
16
16
|
// Layout
|
|
17
17
|
return _jsx(SelectEx, { label: label, name: name, options: identities, ...rest });
|
|
18
18
|
}
|
|
@@ -9,7 +9,7 @@ import Button from "@mui/material/Button";
|
|
|
9
9
|
import Stack from "@mui/material/Stack";
|
|
10
10
|
export function OrgSwitchPopover(props) {
|
|
11
11
|
// Destruct
|
|
12
|
-
const { organizationName } = props;
|
|
12
|
+
const { appId, organizationName } = props;
|
|
13
13
|
// Route
|
|
14
14
|
const navigate = useNavigate();
|
|
15
15
|
// App
|
|
@@ -23,7 +23,7 @@ export function OrgSwitchPopover(props) {
|
|
|
23
23
|
// Current organization
|
|
24
24
|
const currentOrg = app.userData?.organization;
|
|
25
25
|
// Layout
|
|
26
|
-
return (_jsx(ButtonPopover, { button: (callback) => (_jsx(React.Fragment, { children: _jsxs(ButtonGroup, { variant: "text", children: [_jsx(Button, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), _jsx(Button, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: _jsx(AccountTreeIcon, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ maxItems }, { showLoading: false }), children: (data) => {
|
|
26
|
+
return (_jsx(ButtonPopover, { button: (callback) => (_jsx(React.Fragment, { children: _jsxs(ButtonGroup, { variant: "text", children: [_jsx(Button, { sx: { display: { xs: "none", md: "block" } }, title: labels.currentOrg, onClick: () => callback(anchorRef.current), children: organizationName ?? labels.switchOrg }), _jsx(Button, { title: labels.switchOrg, onClick: (e) => callback(e.currentTarget), ref: anchorRef, children: _jsx(AccountTreeIcon, {}) })] }) })), loadData: () => app.core.orgApi.getMy({ appId, maxItems }, { showLoading: false }), children: (data) => {
|
|
27
27
|
if (data == null)
|
|
28
28
|
return _jsx(React.Fragment, {});
|
|
29
29
|
// Remove the current organization
|
package/lib/mjs/i18n/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/smarterp-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.65",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"homepage": "https://github.com/ETSOO/etsoo-smarterp-core#readme",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@babel/cli": "^7.27.
|
|
43
|
+
"@babel/cli": "^7.27.2",
|
|
44
44
|
"@babel/core": "^7.27.1",
|
|
45
45
|
"@babel/plugin-transform-runtime": "^7.27.1",
|
|
46
|
-
"@babel/preset-env": "^7.27.
|
|
46
|
+
"@babel/preset-env": "^7.27.2",
|
|
47
47
|
"@babel/runtime-corejs3": "^7.27.1",
|
|
48
48
|
"@types/react": "^18.3.21",
|
|
49
49
|
"@types/react-dom": "^18.3.7",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"vitest": "^3.1.3"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@etsoo/appscript": "^1.6.
|
|
57
|
-
"@etsoo/materialui": "^1.5.
|
|
58
|
-
"@etsoo/react": "^1.8.
|
|
59
|
-
"@etsoo/shared": "^1.2.
|
|
60
|
-
"@etsoo/toolpad": "^1.0.
|
|
61
|
-
"@mui/material": "^7.0
|
|
56
|
+
"@etsoo/appscript": "^1.6.34",
|
|
57
|
+
"@etsoo/materialui": "^1.5.47",
|
|
58
|
+
"@etsoo/react": "^1.8.44",
|
|
59
|
+
"@etsoo/shared": "^1.2.72",
|
|
60
|
+
"@etsoo/toolpad": "^1.0.39",
|
|
61
|
+
"@mui/material": "^7.1.0",
|
|
62
62
|
"react": "^18.3.1",
|
|
63
63
|
"react-dom": "^18.3.1"
|
|
64
64
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SelectEx, SelectExProps } from "@etsoo/materialui";
|
|
2
2
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
3
3
|
import { ListType } from "@etsoo/shared";
|
|
4
|
+
import { IdentityTypeFlags } from "@etsoo/appscript";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Identity flags list component
|
|
@@ -8,21 +9,24 @@ import { ListType } from "@etsoo/shared";
|
|
|
8
9
|
* @returns Component
|
|
9
10
|
*/
|
|
10
11
|
export function IdentityFlagsList(
|
|
11
|
-
props: Omit<SelectExProps<ListType>, "options">
|
|
12
|
+
props: Omit<SelectExProps<ListType>, "options"> & {
|
|
13
|
+
baseIdentity?: IdentityTypeFlags;
|
|
14
|
+
}
|
|
12
15
|
) {
|
|
13
16
|
// App
|
|
14
17
|
const app = useRequiredAppContext();
|
|
15
18
|
|
|
16
|
-
// Identities
|
|
17
|
-
const identities = app.core.getIdentityFlags();
|
|
18
|
-
|
|
19
19
|
// Destruct
|
|
20
20
|
const {
|
|
21
|
+
baseIdentity,
|
|
21
22
|
label = app.get("identityType"),
|
|
22
23
|
name = "identityType",
|
|
23
24
|
...rest
|
|
24
25
|
} = props;
|
|
25
26
|
|
|
27
|
+
// Identities
|
|
28
|
+
const identities = app.core.getIdentityFlags(baseIdentity);
|
|
29
|
+
|
|
26
30
|
// Layout
|
|
27
31
|
return <SelectEx label={label} name={name} options={identities} {...rest} />;
|
|
28
32
|
}
|
|
@@ -9,12 +9,13 @@ import Button from "@mui/material/Button";
|
|
|
9
9
|
import Stack from "@mui/material/Stack";
|
|
10
10
|
|
|
11
11
|
export type OrgSwitchPopoverProps = {
|
|
12
|
+
appId?: number;
|
|
12
13
|
organizationName?: string;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export function OrgSwitchPopover(props: OrgSwitchPopoverProps) {
|
|
16
17
|
// Destruct
|
|
17
|
-
const { organizationName } = props;
|
|
18
|
+
const { appId, organizationName } = props;
|
|
18
19
|
|
|
19
20
|
// Route
|
|
20
21
|
const navigate = useNavigate();
|
|
@@ -58,7 +59,7 @@ export function OrgSwitchPopover(props: OrgSwitchPopoverProps) {
|
|
|
58
59
|
</React.Fragment>
|
|
59
60
|
)}
|
|
60
61
|
loadData={() =>
|
|
61
|
-
app.core.orgApi.getMy({ maxItems }, { showLoading: false })
|
|
62
|
+
app.core.orgApi.getMy({ appId, maxItems }, { showLoading: false })
|
|
62
63
|
}
|
|
63
64
|
>
|
|
64
65
|
{(data) => {
|
package/src/i18n/en.json
CHANGED
package/src/i18n/zh-Hans.json
CHANGED
package/src/i18n/zh-Hant.json
CHANGED