@etsoo/smarterp-core 1.1.8 → 1.1.10

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.
@@ -100,10 +100,10 @@ export interface ICoreApp {
100
100
  /**
101
101
  * Get identity flags
102
102
  * 获取身份标志组合
103
- * @param identity Identity value combined
103
+ * @param identity Identity value combined or true for items other than None
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,14 +167,23 @@ 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
+ }
182
+ if (identity === 0)
183
+ return [];
184
+ // When identity exists, includes the None item
176
185
  return this.app.getEnumList(appscript_1.IdentityTypeFlags, "id", (id, _key) => {
177
- if ((id & identity) > 0)
186
+ if (id === 0 || (id & identity) > 0)
178
187
  return id;
179
188
  });
180
189
  }
@@ -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;
@@ -40,7 +40,7 @@
40
40
  "fullName": "Full name",
41
41
  "idCustomer": "Customer",
42
42
  "idDept": "Department",
43
- "idNone": "None",
43
+ "idNone": "Contact",
44
44
  "idOrg": "Organization",
45
45
  "idSupplier": "Supplier",
46
46
  "idUser": "User",
@@ -40,7 +40,7 @@
40
40
  "fullName": "全称",
41
41
  "idCustomer": "客户",
42
42
  "idDept": "部门",
43
- "idNone": "",
43
+ "idNone": "联系人",
44
44
  "idOrg": "机构",
45
45
  "idSupplier": "供应商",
46
46
  "idUser": "用户",
@@ -43,7 +43,7 @@
43
43
  "lightMode": "淺色模式",
44
44
  "idCustomer": "客戶",
45
45
  "idDept": "部門",
46
- "idNone": "",
46
+ "idNone": "聯絡人",
47
47
  "idOrg": "機構",
48
48
  "idSupplier": "供應商",
49
49
  "idUser": "用户",
@@ -100,10 +100,10 @@ export interface ICoreApp {
100
100
  /**
101
101
  * Get identity flags
102
102
  * 获取身份标志组合
103
- * @param identity Identity value combined
103
+ * @param identity Identity value combined or true for items other than None
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,14 +164,23 @@ 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
+ }
179
+ if (identity === 0)
180
+ return [];
181
+ // When identity exists, includes the None item
173
182
  return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
174
- if ((id & identity) > 0)
183
+ if (id === 0 || (id & identity) > 0)
175
184
  return id;
176
185
  });
177
186
  }
@@ -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;
@@ -40,7 +40,7 @@
40
40
  "fullName": "Full name",
41
41
  "idCustomer": "Customer",
42
42
  "idDept": "Department",
43
- "idNone": "None",
43
+ "idNone": "Contact",
44
44
  "idOrg": "Organization",
45
45
  "idSupplier": "Supplier",
46
46
  "idUser": "User",
@@ -40,7 +40,7 @@
40
40
  "fullName": "全称",
41
41
  "idCustomer": "客户",
42
42
  "idDept": "部门",
43
- "idNone": "",
43
+ "idNone": "联系人",
44
44
  "idOrg": "机构",
45
45
  "idSupplier": "供应商",
46
46
  "idUser": "用户",
@@ -43,7 +43,7 @@
43
43
  "lightMode": "淺色模式",
44
44
  "idCustomer": "客戶",
45
45
  "idDept": "部門",
46
- "idNone": "",
46
+ "idNone": "聯絡人",
47
47
  "idOrg": "機構",
48
48
  "idSupplier": "供應商",
49
49
  "idUser": "用户",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/CoreApp.ts CHANGED
@@ -123,10 +123,10 @@ export interface ICoreApp {
123
123
  /**
124
124
  * Get identity flags
125
125
  * 获取身份标志组合
126
- * @param identity Identity value combined
126
+ * @param identity Identity value combined or true for items other than None
127
127
  * @returns List
128
128
  */
129
- getIdentityFlags(identity?: number): ListType[];
129
+ getIdentityFlags(identity?: number | true): ListType[];
130
130
  }
131
131
 
132
132
  /**
@@ -304,17 +304,23 @@ 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
 
319
+ if (identity === 0) return [];
320
+
321
+ // When identity exists, includes the None item
316
322
  return this.app.getEnumList(IdentityTypeFlags, "id", (id, _key) => {
317
- if ((id & identity) > 0) return id;
323
+ if (id === 0 || (id & identity) > 0) return id;
318
324
  });
319
325
  }
320
326
  }
@@ -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
@@ -40,7 +40,7 @@
40
40
  "fullName": "Full name",
41
41
  "idCustomer": "Customer",
42
42
  "idDept": "Department",
43
- "idNone": "None",
43
+ "idNone": "Contact",
44
44
  "idOrg": "Organization",
45
45
  "idSupplier": "Supplier",
46
46
  "idUser": "User",
@@ -40,7 +40,7 @@
40
40
  "fullName": "全称",
41
41
  "idCustomer": "客户",
42
42
  "idDept": "部门",
43
- "idNone": "",
43
+ "idNone": "联系人",
44
44
  "idOrg": "机构",
45
45
  "idSupplier": "供应商",
46
46
  "idUser": "用户",
@@ -43,7 +43,7 @@
43
43
  "lightMode": "淺色模式",
44
44
  "idCustomer": "客戶",
45
45
  "idDept": "部門",
46
- "idNone": "",
46
+ "idNone": "聯絡人",
47
47
  "idOrg": "機構",
48
48
  "idSupplier": "供應商",
49
49
  "idUser": "用户",