@etsoo/smarterp-core 1.1.7 → 1.1.9
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/CoreApp.d.ts +3 -3
- package/lib/cjs/CoreApp.js +8 -2
- package/lib/cjs/components/app/ButtonIdentityTypes.js +1 -1
- package/lib/cjs/components/app/IdentityFlagsList.d.ts +1 -1
- package/lib/cjs/i18n/en.json +0 -1
- package/lib/cjs/i18n/zh-Hans.json +0 -1
- package/lib/cjs/i18n/zh-Hant.json +0 -1
- package/lib/mjs/CoreApp.d.ts +3 -3
- package/lib/mjs/CoreApp.js +8 -2
- package/lib/mjs/components/app/ButtonIdentityTypes.js +1 -1
- package/lib/mjs/components/app/IdentityFlagsList.d.ts +1 -1
- package/lib/mjs/i18n/en.json +0 -1
- package/lib/mjs/i18n/zh-Hans.json +0 -1
- package/lib/mjs/i18n/zh-Hant.json +0 -1
- package/package.json +8 -4
- package/src/CoreApp.ts +10 -7
- package/src/components/app/ButtonIdentityTypes.tsx +1 -1
- package/src/components/app/IdentityFlagsList.tsx +1 -1
- package/src/i18n/en.json +0 -1
- package/src/i18n/zh-Hans.json +0 -1
- package/src/i18n/zh-Hant.json +0 -1
package/lib/cjs/CoreApp.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export interface ICoreApp {
|
|
|
103
103
|
* @param identity Identity value combined
|
|
104
104
|
* @returns List
|
|
105
105
|
*/
|
|
106
|
-
getIdentityFlags(identity?: number): ListType[];
|
|
106
|
+
getIdentityFlags(identity?: number | true): ListType[];
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Core application
|
|
@@ -214,9 +214,9 @@ export declare class CoreApp implements ICoreApp {
|
|
|
214
214
|
/**
|
|
215
215
|
* Get identity flags
|
|
216
216
|
* 获取身份标志组合
|
|
217
|
-
* @param identity Identity value combined
|
|
217
|
+
* @param identity Identity value combined or true for items other than None
|
|
218
218
|
* @returns List
|
|
219
219
|
*/
|
|
220
|
-
getIdentityFlags(identity?: number): ListType[];
|
|
220
|
+
getIdentityFlags(identity?: number | true): ListType[];
|
|
221
221
|
}
|
|
222
222
|
export {};
|
package/lib/cjs/CoreApp.js
CHANGED
|
@@ -167,12 +167,18 @@ class CoreApp {
|
|
|
167
167
|
/**
|
|
168
168
|
* Get identity flags
|
|
169
169
|
* 获取身份标志组合
|
|
170
|
-
* @param identity Identity value combined
|
|
170
|
+
* @param identity Identity value combined or true for items other than None
|
|
171
171
|
* @returns List
|
|
172
172
|
*/
|
|
173
173
|
getIdentityFlags(identity) {
|
|
174
174
|
if (identity == null)
|
|
175
|
-
return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id"
|
|
175
|
+
return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id");
|
|
176
|
+
if (identity === true) {
|
|
177
|
+
return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id", (id, _key) => {
|
|
178
|
+
if (id > 0)
|
|
179
|
+
return id;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
176
182
|
return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id", (id, _key) => {
|
|
177
183
|
if ((id & identity) > 0)
|
|
178
184
|
return id;
|
|
@@ -15,7 +15,7 @@ function ButtonIdentityTypes(props) {
|
|
|
15
15
|
// Labels
|
|
16
16
|
const labels = app.getLabels("clickToChoose", "identityType");
|
|
17
17
|
// Destruct
|
|
18
|
-
const { inputName = "identityType", label = labels.identityType, labelEnd = labels.clickToChoose, baseIdentity, onValueChange, value, ...rest } = props;
|
|
18
|
+
const { inputName = "identityType", label = labels.identityType, labelEnd = labels.clickToChoose, baseIdentity = true, onValueChange, value, ...rest } = props;
|
|
19
19
|
// Identities
|
|
20
20
|
const identities = react_1.default.useMemo(() => app.core.getIdentityFlags(baseIdentity), [baseIdentity]);
|
|
21
21
|
const ids = [];
|
|
@@ -7,5 +7,5 @@ import { IdentityTypeFlags } from "@etsoo/appscript";
|
|
|
7
7
|
* @returns Component
|
|
8
8
|
*/
|
|
9
9
|
export declare function IdentityFlagsList(props: Omit<SelectExProps<ListType>, "options"> & {
|
|
10
|
-
baseIdentity?: IdentityTypeFlags;
|
|
10
|
+
baseIdentity?: IdentityTypeFlags | true;
|
|
11
11
|
}): import("react/jsx-runtime").JSX.Element;
|
package/lib/cjs/i18n/en.json
CHANGED
package/lib/mjs/CoreApp.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export interface ICoreApp {
|
|
|
103
103
|
* @param identity Identity value combined
|
|
104
104
|
* @returns List
|
|
105
105
|
*/
|
|
106
|
-
getIdentityFlags(identity?: number): ListType[];
|
|
106
|
+
getIdentityFlags(identity?: number | true): ListType[];
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Core application
|
|
@@ -214,9 +214,9 @@ export declare class CoreApp implements ICoreApp {
|
|
|
214
214
|
/**
|
|
215
215
|
* Get identity flags
|
|
216
216
|
* 获取身份标志组合
|
|
217
|
-
* @param identity Identity value combined
|
|
217
|
+
* @param identity Identity value combined or true for items other than None
|
|
218
218
|
* @returns List
|
|
219
219
|
*/
|
|
220
|
-
getIdentityFlags(identity?: number): ListType[];
|
|
220
|
+
getIdentityFlags(identity?: number | true): ListType[];
|
|
221
221
|
}
|
|
222
222
|
export {};
|
package/lib/mjs/CoreApp.js
CHANGED
|
@@ -164,12 +164,18 @@ export class CoreApp {
|
|
|
164
164
|
/**
|
|
165
165
|
* Get identity flags
|
|
166
166
|
* 获取身份标志组合
|
|
167
|
-
* @param identity Identity value combined
|
|
167
|
+
* @param identity Identity value combined or true for items other than None
|
|
168
168
|
* @returns List
|
|
169
169
|
*/
|
|
170
170
|
getIdentityFlags(identity) {
|
|
171
171
|
if (identity == null)
|
|
172
|
-
return this.app.getEnumList(IdentityTypeFlags, "id"
|
|
172
|
+
return this.app.getEnumList(IdentityTypeFlags, "id");
|
|
173
|
+
if (identity === true) {
|
|
174
|
+
return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
|
|
175
|
+
if (id > 0)
|
|
176
|
+
return id;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
173
179
|
return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
|
|
174
180
|
if ((id & identity) > 0)
|
|
175
181
|
return id;
|
|
@@ -9,7 +9,7 @@ export function ButtonIdentityTypes(props) {
|
|
|
9
9
|
// Labels
|
|
10
10
|
const labels = app.getLabels("clickToChoose", "identityType");
|
|
11
11
|
// Destruct
|
|
12
|
-
const { inputName = "identityType", label = labels.identityType, labelEnd = labels.clickToChoose, baseIdentity, onValueChange, value, ...rest } = props;
|
|
12
|
+
const { inputName = "identityType", label = labels.identityType, labelEnd = labels.clickToChoose, baseIdentity = true, onValueChange, value, ...rest } = props;
|
|
13
13
|
// Identities
|
|
14
14
|
const identities = React.useMemo(() => app.core.getIdentityFlags(baseIdentity), [baseIdentity]);
|
|
15
15
|
const ids = [];
|
|
@@ -7,5 +7,5 @@ import { IdentityTypeFlags } from "@etsoo/appscript";
|
|
|
7
7
|
* @returns Component
|
|
8
8
|
*/
|
|
9
9
|
export declare function IdentityFlagsList(props: Omit<SelectExProps<ListType>, "options"> & {
|
|
10
|
-
baseIdentity?: IdentityTypeFlags;
|
|
10
|
+
baseIdentity?: IdentityTypeFlags | true;
|
|
11
11
|
}): import("react/jsx-runtime").JSX.Element;
|
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.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -52,10 +52,14 @@
|
|
|
52
52
|
"typescript": "^5.9.3",
|
|
53
53
|
"vitest": "^4.0.16"
|
|
54
54
|
},
|
|
55
|
+
"overrides": {
|
|
56
|
+
"react": "$react",
|
|
57
|
+
"react-dom": "$react-dom"
|
|
58
|
+
},
|
|
55
59
|
"dependencies": {
|
|
56
|
-
"@etsoo/appscript": "^1.6.
|
|
57
|
-
"@etsoo/materialui": "^1.5.
|
|
58
|
-
"@etsoo/react": "^1.8.
|
|
60
|
+
"@etsoo/appscript": "^1.6.51",
|
|
61
|
+
"@etsoo/materialui": "^1.5.94",
|
|
62
|
+
"@etsoo/react": "^1.8.67",
|
|
59
63
|
"@etsoo/shared": "^1.2.80",
|
|
60
64
|
"@etsoo/toolpad": "^1.0.44",
|
|
61
65
|
"@mui/material": "^7.3.6",
|
package/src/CoreApp.ts
CHANGED
|
@@ -126,7 +126,7 @@ export interface ICoreApp {
|
|
|
126
126
|
* @param identity Identity value combined
|
|
127
127
|
* @returns List
|
|
128
128
|
*/
|
|
129
|
-
getIdentityFlags(identity?: number): ListType[];
|
|
129
|
+
getIdentityFlags(identity?: number | true): ListType[];
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/**
|
|
@@ -304,14 +304,17 @@ export class CoreApp implements ICoreApp {
|
|
|
304
304
|
/**
|
|
305
305
|
* Get identity flags
|
|
306
306
|
* 获取身份标志组合
|
|
307
|
-
* @param identity Identity value combined
|
|
307
|
+
* @param identity Identity value combined or true for items other than None
|
|
308
308
|
* @returns List
|
|
309
309
|
*/
|
|
310
|
-
getIdentityFlags(identity?: number) {
|
|
311
|
-
if (identity == null)
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
)
|
|
310
|
+
getIdentityFlags(identity?: number | true) {
|
|
311
|
+
if (identity == null) return this.app.getEnumList(IdentityTypeFlags, "id");
|
|
312
|
+
|
|
313
|
+
if (identity === true) {
|
|
314
|
+
return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
|
|
315
|
+
if (id > 0) return id;
|
|
316
|
+
});
|
|
317
|
+
}
|
|
315
318
|
|
|
316
319
|
return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
|
|
317
320
|
if ((id & identity) > 0) return id;
|
package/src/i18n/en.json
CHANGED
package/src/i18n/zh-Hans.json
CHANGED