@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.
@@ -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 {};
@@ -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", (id) => id > 0 ? id : undefined);
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;
@@ -38,7 +38,6 @@
38
38
  "externalApis": "External APIs",
39
39
  "fileName": "File name",
40
40
  "fullName": "Full name",
41
- "idContact": "Contact",
42
41
  "idCustomer": "Customer",
43
42
  "idDept": "Department",
44
43
  "idNone": "None",
@@ -38,7 +38,6 @@
38
38
  "externalApis": "外部接口",
39
39
  "fileName": "文件名",
40
40
  "fullName": "全称",
41
- "idContact": "联系人",
42
41
  "idCustomer": "客户",
43
42
  "idDept": "部门",
44
43
  "idNone": "无",
@@ -41,7 +41,6 @@
41
41
  "latinFamilyName": "姓氏(拼音)",
42
42
  "latinGivenName": "名(拼音)",
43
43
  "lightMode": "淺色模式",
44
- "idContact": "聯絡人",
45
44
  "idCustomer": "客戶",
46
45
  "idDept": "部門",
47
46
  "idNone": "無",
@@ -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 {};
@@ -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", (id) => id > 0 ? id : undefined);
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;
@@ -38,7 +38,6 @@
38
38
  "externalApis": "External APIs",
39
39
  "fileName": "File name",
40
40
  "fullName": "Full name",
41
- "idContact": "Contact",
42
41
  "idCustomer": "Customer",
43
42
  "idDept": "Department",
44
43
  "idNone": "None",
@@ -38,7 +38,6 @@
38
38
  "externalApis": "外部接口",
39
39
  "fileName": "文件名",
40
40
  "fullName": "全称",
41
- "idContact": "联系人",
42
41
  "idCustomer": "客户",
43
42
  "idDept": "部门",
44
43
  "idNone": "无",
@@ -41,7 +41,6 @@
41
41
  "latinFamilyName": "姓氏(拼音)",
42
42
  "latinGivenName": "名(拼音)",
43
43
  "lightMode": "淺色模式",
44
- "idContact": "聯絡人",
45
44
  "idCustomer": "客戶",
46
45
  "idDept": "部門",
47
46
  "idNone": "無",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.1.7",
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.50",
57
- "@etsoo/materialui": "^1.5.93",
58
- "@etsoo/react": "^1.8.66",
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
- return this.app.getEnumList(IdentityTypeFlags, "id", (id) =>
313
- id > 0 ? id : undefined
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;
@@ -41,7 +41,7 @@ export function ButtonIdentityTypes(props: ButtonIdentityTypesProps) {
41
41
  inputName = "identityType",
42
42
  label = labels.identityType,
43
43
  labelEnd = labels.clickToChoose,
44
- baseIdentity,
44
+ baseIdentity = true,
45
45
  onValueChange,
46
46
  value,
47
47
  ...rest
@@ -10,7 +10,7 @@ import { IdentityTypeFlags } from "@etsoo/appscript";
10
10
  */
11
11
  export function IdentityFlagsList(
12
12
  props: Omit<SelectExProps<ListType>, "options"> & {
13
- baseIdentity?: IdentityTypeFlags;
13
+ baseIdentity?: IdentityTypeFlags | true;
14
14
  }
15
15
  ) {
16
16
  // App
package/src/i18n/en.json CHANGED
@@ -38,7 +38,6 @@
38
38
  "externalApis": "External APIs",
39
39
  "fileName": "File name",
40
40
  "fullName": "Full name",
41
- "idContact": "Contact",
42
41
  "idCustomer": "Customer",
43
42
  "idDept": "Department",
44
43
  "idNone": "None",
@@ -38,7 +38,6 @@
38
38
  "externalApis": "外部接口",
39
39
  "fileName": "文件名",
40
40
  "fullName": "全称",
41
- "idContact": "联系人",
42
41
  "idCustomer": "客户",
43
42
  "idDept": "部门",
44
43
  "idNone": "无",
@@ -41,7 +41,6 @@
41
41
  "latinFamilyName": "姓氏(拼音)",
42
42
  "latinGivenName": "名(拼音)",
43
43
  "lightMode": "淺色模式",
44
- "idContact": "聯絡人",
45
44
  "idCustomer": "客戶",
46
45
  "idDept": "部門",
47
46
  "idNone": "無",