@etsoo/smarterp-core 1.0.70 → 1.0.71
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.js
CHANGED
|
@@ -151,7 +151,7 @@ class CoreApp {
|
|
|
151
151
|
*/
|
|
152
152
|
getIdentityFlags(identity) {
|
|
153
153
|
if (identity == null)
|
|
154
|
-
return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id");
|
|
154
|
+
return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id", (id) => id > 0 ? id : undefined);
|
|
155
155
|
return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id", (id, _key) => {
|
|
156
156
|
if ((id & identity) > 0)
|
|
157
157
|
return id;
|
|
@@ -17,7 +17,7 @@ function ButtonIdentityTypes(props) {
|
|
|
17
17
|
// Destruct
|
|
18
18
|
const { inputName = "identityType", label = labels.identityType, labelEnd = labels.clickToChoose, baseIdentity, onValueChange, value, ...rest } = props;
|
|
19
19
|
// Identities
|
|
20
|
-
const identities = react_1.default.useMemo(() => app.core.getIdentityFlags(baseIdentity)
|
|
20
|
+
const identities = react_1.default.useMemo(() => app.core.getIdentityFlags(baseIdentity), [baseIdentity]);
|
|
21
21
|
const ids = [];
|
|
22
22
|
if (value != null) {
|
|
23
23
|
// Convert to ids
|
package/lib/mjs/CoreApp.js
CHANGED
|
@@ -148,7 +148,7 @@ export class CoreApp {
|
|
|
148
148
|
*/
|
|
149
149
|
getIdentityFlags(identity) {
|
|
150
150
|
if (identity == null)
|
|
151
|
-
return this.app.getEnumList(IdentityTypeFlags, "id");
|
|
151
|
+
return this.app.getEnumList(IdentityTypeFlags, "id", (id) => id > 0 ? id : undefined);
|
|
152
152
|
return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
|
|
153
153
|
if ((id & identity) > 0)
|
|
154
154
|
return id;
|
|
@@ -11,7 +11,7 @@ export function ButtonIdentityTypes(props) {
|
|
|
11
11
|
// Destruct
|
|
12
12
|
const { inputName = "identityType", label = labels.identityType, labelEnd = labels.clickToChoose, baseIdentity, onValueChange, value, ...rest } = props;
|
|
13
13
|
// Identities
|
|
14
|
-
const identities = React.useMemo(() => app.core.getIdentityFlags(baseIdentity)
|
|
14
|
+
const identities = React.useMemo(() => app.core.getIdentityFlags(baseIdentity), [baseIdentity]);
|
|
15
15
|
const ids = [];
|
|
16
16
|
if (value != null) {
|
|
17
17
|
// Convert to ids
|
package/package.json
CHANGED
package/src/CoreApp.ts
CHANGED
|
@@ -270,7 +270,11 @@ export class CoreApp implements ICoreApp {
|
|
|
270
270
|
* @returns List
|
|
271
271
|
*/
|
|
272
272
|
getIdentityFlags(identity?: number) {
|
|
273
|
-
if (identity == null)
|
|
273
|
+
if (identity == null)
|
|
274
|
+
return this.app.getEnumList(IdentityTypeFlags, "id", (id) =>
|
|
275
|
+
id > 0 ? id : undefined
|
|
276
|
+
);
|
|
277
|
+
|
|
274
278
|
return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
|
|
275
279
|
if ((id & identity) > 0) return id;
|
|
276
280
|
});
|
|
@@ -49,7 +49,7 @@ export function ButtonIdentityTypes(props: ButtonIdentityTypesProps) {
|
|
|
49
49
|
|
|
50
50
|
// Identities
|
|
51
51
|
const identities = React.useMemo(
|
|
52
|
-
() => app.core.getIdentityFlags(baseIdentity)
|
|
52
|
+
() => app.core.getIdentityFlags(baseIdentity),
|
|
53
53
|
[baseIdentity]
|
|
54
54
|
);
|
|
55
55
|
|