@etsoo/smarterp-core 1.0.73 → 1.0.75
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/ButtonIdentityTypes.js +1 -1
- package/lib/cjs/components/public/ButtonCultures.js +7 -1
- package/lib/cjs/components/public/ButtonCurrencies.js +7 -1
- package/lib/cjs/components/public/ButtonRegions.js +7 -1
- package/lib/mjs/components/app/ButtonIdentityTypes.js +1 -1
- package/lib/mjs/components/public/ButtonCultures.js +4 -1
- package/lib/mjs/components/public/ButtonCurrencies.js +4 -1
- package/lib/mjs/components/public/ButtonRegions.js +4 -1
- package/package.json +3 -3
- package/src/components/app/ButtonIdentityTypes.tsx +1 -1
- package/src/components/public/ButtonCultures.tsx +8 -3
- package/src/components/public/ButtonCurrencies.tsx +9 -3
- package/src/components/public/ButtonRegions.tsx +8 -3
|
@@ -27,7 +27,7 @@ function ButtonIdentityTypes(props) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => data.label, labelEnd: labelEnd, labelField: "label", loadData:
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => data.label, labelEnd: labelEnd, labelField: "label", loadData: identities, value: ids, onValueChange: (ids) => {
|
|
31
31
|
let newValue = appscript_1.IdentityTypeFlags.None;
|
|
32
32
|
for (const id of ids) {
|
|
33
33
|
newValue |= id;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ButtonCultures = ButtonCultures;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const materialui_1 = require("@etsoo/materialui");
|
|
6
9
|
const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
7
11
|
function ButtonCultures(props) {
|
|
8
12
|
// App
|
|
9
13
|
const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
|
|
@@ -24,7 +28,9 @@ function ButtonCultures(props) {
|
|
|
24
28
|
"ar"
|
|
25
29
|
];
|
|
26
30
|
defaultCultures.sort((a) => (app.culture.startsWith(a) ? -1 : 0));
|
|
27
|
-
|
|
31
|
+
// Load data
|
|
32
|
+
const loadData = react_1.default.useCallback(async () => (await app.core.publicApi.getCultures(defaultCultures)) ?? [], []);
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => `${data.name === data.id ? data.englishName : data.name} (${data.id})`, labelEnd: labelEnd, labelField: "name", loadData: loadData, onAdd: async (ids) => {
|
|
28
34
|
const data = await app.core.publicApi.getCultures(ids);
|
|
29
35
|
if (data == null)
|
|
30
36
|
return false;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ButtonCurrencies = ButtonCurrencies;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const materialui_1 = require("@etsoo/materialui");
|
|
6
9
|
const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
7
11
|
function ButtonCurrencies(props) {
|
|
8
12
|
// App
|
|
9
13
|
const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
|
|
@@ -24,7 +28,9 @@ function ButtonCurrencies(props) {
|
|
|
24
28
|
"NZD"
|
|
25
29
|
];
|
|
26
30
|
defaultCurrencies.sort((a) => (a.startsWith(app.region) ? -1 : 0));
|
|
27
|
-
|
|
31
|
+
// Load data
|
|
32
|
+
const loadData = react_1.default.useCallback(async () => (await app.core.publicApi.getCurrencies(defaultCurrencies)) ?? [], []);
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => `${data.name} (${data.id})`, labelEnd: labelEnd, labelField: "name", loadData: loadData, onAdd: async (ids) => {
|
|
28
34
|
const data = await app.core.publicApi.getCurrencies(ids);
|
|
29
35
|
if (data == null)
|
|
30
36
|
return false;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ButtonRegions = ButtonRegions;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const materialui_1 = require("@etsoo/materialui");
|
|
6
9
|
const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
7
11
|
function ButtonRegions(props) {
|
|
8
12
|
// App
|
|
9
13
|
const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
|
|
@@ -25,7 +29,9 @@ function ButtonRegions(props) {
|
|
|
25
29
|
"SG",
|
|
26
30
|
"HK"
|
|
27
31
|
];
|
|
28
|
-
|
|
32
|
+
// Load data
|
|
33
|
+
const loadData = react_1.default.useCallback(async () => (await app.core.publicApi.getRegions(defaultRegions)) ?? [], []);
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => `${data.name} (${data.id})`, labelEnd: labelEnd, labelField: "name", loadData: loadData, onAdd: async (ids) => {
|
|
29
35
|
const data = await app.core.publicApi.getRegions(ids);
|
|
30
36
|
if (data == null)
|
|
31
37
|
return false;
|
|
@@ -21,7 +21,7 @@ export function ButtonIdentityTypes(props) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
return (_jsx(ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => data.label, labelEnd: labelEnd, labelField: "label", loadData:
|
|
24
|
+
return (_jsx(ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => data.label, labelEnd: labelEnd, labelField: "label", loadData: identities, value: ids, onValueChange: (ids) => {
|
|
25
25
|
let newValue = IdentityTypeFlags.None;
|
|
26
26
|
for (const id of ids) {
|
|
27
27
|
newValue |= id;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ButtonPopupCheckbox } from "@etsoo/materialui";
|
|
3
3
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
4
|
+
import React from "react";
|
|
4
5
|
export function ButtonCultures(props) {
|
|
5
6
|
// App
|
|
6
7
|
const app = useRequiredAppContext();
|
|
@@ -21,7 +22,9 @@ export function ButtonCultures(props) {
|
|
|
21
22
|
"ar"
|
|
22
23
|
];
|
|
23
24
|
defaultCultures.sort((a) => (app.culture.startsWith(a) ? -1 : 0));
|
|
24
|
-
|
|
25
|
+
// Load data
|
|
26
|
+
const loadData = React.useCallback(async () => (await app.core.publicApi.getCultures(defaultCultures)) ?? [], []);
|
|
27
|
+
return (_jsx(ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => `${data.name === data.id ? data.englishName : data.name} (${data.id})`, labelEnd: labelEnd, labelField: "name", loadData: loadData, onAdd: async (ids) => {
|
|
25
28
|
const data = await app.core.publicApi.getCultures(ids);
|
|
26
29
|
if (data == null)
|
|
27
30
|
return false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ButtonPopupCheckbox } from "@etsoo/materialui";
|
|
3
3
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
4
|
+
import React from "react";
|
|
4
5
|
export function ButtonCurrencies(props) {
|
|
5
6
|
// App
|
|
6
7
|
const app = useRequiredAppContext();
|
|
@@ -21,7 +22,9 @@ export function ButtonCurrencies(props) {
|
|
|
21
22
|
"NZD"
|
|
22
23
|
];
|
|
23
24
|
defaultCurrencies.sort((a) => (a.startsWith(app.region) ? -1 : 0));
|
|
24
|
-
|
|
25
|
+
// Load data
|
|
26
|
+
const loadData = React.useCallback(async () => (await app.core.publicApi.getCurrencies(defaultCurrencies)) ?? [], []);
|
|
27
|
+
return (_jsx(ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => `${data.name} (${data.id})`, labelEnd: labelEnd, labelField: "name", loadData: loadData, onAdd: async (ids) => {
|
|
25
28
|
const data = await app.core.publicApi.getCurrencies(ids);
|
|
26
29
|
if (data == null)
|
|
27
30
|
return false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ButtonPopupCheckbox } from "@etsoo/materialui";
|
|
3
3
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
4
|
+
import React from "react";
|
|
4
5
|
export function ButtonRegions(props) {
|
|
5
6
|
// App
|
|
6
7
|
const app = useRequiredAppContext();
|
|
@@ -22,7 +23,9 @@ export function ButtonRegions(props) {
|
|
|
22
23
|
"SG",
|
|
23
24
|
"HK"
|
|
24
25
|
];
|
|
25
|
-
|
|
26
|
+
// Load data
|
|
27
|
+
const loadData = React.useCallback(async () => (await app.core.publicApi.getRegions(defaultRegions)) ?? [], []);
|
|
28
|
+
return (_jsx(ButtonPopupCheckbox, { inputName: inputName, label: label, labelFormatter: (data) => `${data.name} (${data.id})`, labelEnd: labelEnd, labelField: "name", loadData: loadData, onAdd: async (ids) => {
|
|
26
29
|
const data = await app.core.publicApi.getRegions(ids);
|
|
27
30
|
if (data == null)
|
|
28
31
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/smarterp-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.75",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@etsoo/appscript": "^1.6.38",
|
|
57
|
-
"@etsoo/materialui": "^1.5.
|
|
58
|
-
"@etsoo/react": "^1.8.
|
|
57
|
+
"@etsoo/materialui": "^1.5.61",
|
|
58
|
+
"@etsoo/react": "^1.8.48",
|
|
59
59
|
"@etsoo/shared": "^1.2.74",
|
|
60
60
|
"@etsoo/toolpad": "^1.0.39",
|
|
61
61
|
"@mui/material": "^7.1.1",
|
|
@@ -70,7 +70,7 @@ export function ButtonIdentityTypes(props: ButtonIdentityTypesProps) {
|
|
|
70
70
|
labelFormatter={(data) => data.label}
|
|
71
71
|
labelEnd={labelEnd}
|
|
72
72
|
labelField="label"
|
|
73
|
-
loadData={
|
|
73
|
+
loadData={identities}
|
|
74
74
|
value={ids}
|
|
75
75
|
onValueChange={(ids) => {
|
|
76
76
|
let newValue = IdentityTypeFlags.None;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "@etsoo/materialui";
|
|
5
5
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
6
6
|
import { CultureItem } from "@etsoo/appscript";
|
|
7
|
+
import React from "react";
|
|
7
8
|
|
|
8
9
|
export function ButtonCultures(
|
|
9
10
|
props: Omit<ButtonPopupCheckboxProps<CultureItem>, "labelField" | "loadData">
|
|
@@ -37,6 +38,12 @@ export function ButtonCultures(
|
|
|
37
38
|
|
|
38
39
|
defaultCultures.sort((a) => (app.culture.startsWith(a) ? -1 : 0));
|
|
39
40
|
|
|
41
|
+
// Load data
|
|
42
|
+
const loadData = React.useCallback(
|
|
43
|
+
async () => (await app.core.publicApi.getCultures(defaultCultures)) ?? [],
|
|
44
|
+
[]
|
|
45
|
+
);
|
|
46
|
+
|
|
40
47
|
return (
|
|
41
48
|
<ButtonPopupCheckbox<CultureItem>
|
|
42
49
|
inputName={inputName}
|
|
@@ -46,9 +53,7 @@ export function ButtonCultures(
|
|
|
46
53
|
}
|
|
47
54
|
labelEnd={labelEnd}
|
|
48
55
|
labelField="name"
|
|
49
|
-
loadData={
|
|
50
|
-
(await app.core.publicApi.getCultures(defaultCultures)) ?? []
|
|
51
|
-
}
|
|
56
|
+
loadData={loadData}
|
|
52
57
|
onAdd={async (ids) => {
|
|
53
58
|
const data = await app.core.publicApi.getCultures(ids);
|
|
54
59
|
if (data == null) return false;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "@etsoo/materialui";
|
|
5
5
|
import { CurrencyItem } from "../../dto/public/CurrencyItem";
|
|
6
6
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
7
|
+
import React from "react";
|
|
7
8
|
|
|
8
9
|
export function ButtonCurrencies(
|
|
9
10
|
props: Omit<ButtonPopupCheckboxProps<CurrencyItem>, "labelField" | "loadData">
|
|
@@ -37,6 +38,13 @@ export function ButtonCurrencies(
|
|
|
37
38
|
|
|
38
39
|
defaultCurrencies.sort((a) => (a.startsWith(app.region) ? -1 : 0));
|
|
39
40
|
|
|
41
|
+
// Load data
|
|
42
|
+
const loadData = React.useCallback(
|
|
43
|
+
async () =>
|
|
44
|
+
(await app.core.publicApi.getCurrencies(defaultCurrencies)) ?? [],
|
|
45
|
+
[]
|
|
46
|
+
);
|
|
47
|
+
|
|
40
48
|
return (
|
|
41
49
|
<ButtonPopupCheckbox<CurrencyItem>
|
|
42
50
|
inputName={inputName}
|
|
@@ -44,9 +52,7 @@ export function ButtonCurrencies(
|
|
|
44
52
|
labelFormatter={(data) => `${data.name} (${data.id})`}
|
|
45
53
|
labelEnd={labelEnd}
|
|
46
54
|
labelField="name"
|
|
47
|
-
loadData={
|
|
48
|
-
(await app.core.publicApi.getCurrencies(defaultCurrencies)) ?? []
|
|
49
|
-
}
|
|
55
|
+
loadData={loadData}
|
|
50
56
|
onAdd={async (ids) => {
|
|
51
57
|
const data = await app.core.publicApi.getCurrencies(ids);
|
|
52
58
|
if (data == null) return false;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "@etsoo/materialui";
|
|
5
5
|
import { RegionData } from "../../dto/public/RegionData";
|
|
6
6
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
7
|
+
import React from "react";
|
|
7
8
|
|
|
8
9
|
export function ButtonRegions(
|
|
9
10
|
props: Omit<ButtonPopupCheckboxProps<RegionData>, "labelField" | "loadData">
|
|
@@ -37,6 +38,12 @@ export function ButtonRegions(
|
|
|
37
38
|
"HK"
|
|
38
39
|
];
|
|
39
40
|
|
|
41
|
+
// Load data
|
|
42
|
+
const loadData = React.useCallback(
|
|
43
|
+
async () => (await app.core.publicApi.getRegions(defaultRegions)) ?? [],
|
|
44
|
+
[]
|
|
45
|
+
);
|
|
46
|
+
|
|
40
47
|
return (
|
|
41
48
|
<ButtonPopupCheckbox<RegionData>
|
|
42
49
|
inputName={inputName}
|
|
@@ -44,9 +51,7 @@ export function ButtonRegions(
|
|
|
44
51
|
labelFormatter={(data) => `${data.name} (${data.id})`}
|
|
45
52
|
labelEnd={labelEnd}
|
|
46
53
|
labelField="name"
|
|
47
|
-
loadData={
|
|
48
|
-
(await app.core.publicApi.getRegions(defaultRegions)) ?? []
|
|
49
|
-
}
|
|
54
|
+
loadData={loadData}
|
|
50
55
|
onAdd={async (ids) => {
|
|
51
56
|
const data = await app.core.publicApi.getRegions(ids);
|
|
52
57
|
if (data == null) return false;
|