@etsoo/appscript 1.6.52 → 1.6.54

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.
@@ -1,6 +1,7 @@
1
1
  import { DataTypes, IdType, ListType } from "@etsoo/shared";
2
2
  import { CustomCultureData } from "../def/CustomCulture";
3
3
  import { QueryRQ } from "../api/rq/QueryRQ";
4
+ import { AssetUnits, ProductUnit } from "./ProductUnit";
4
5
  /**
5
6
  * Business utils
6
7
  */
@@ -32,6 +33,12 @@ export declare namespace BusinessUtils {
32
33
  * @returns 12 months
33
34
  */
34
35
  function getMonths(monthLabels: string[], startMonth?: number): ListType[];
36
+ /**
37
+ * Is asset unit
38
+ * @param unit Product unit
39
+ * @returns Result
40
+ */
41
+ function isAssetUnit(unit: ProductUnit): unit is AssetUnits;
35
42
  /**
36
43
  * Check if the item is a custom culture data
37
44
  * @param item Item to check
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BusinessUtils = void 0;
4
+ const ProductUnit_1 = require("./ProductUnit");
4
5
  /**
5
6
  * Business utils
6
7
  */
@@ -69,6 +70,17 @@ var BusinessUtils;
69
70
  return months;
70
71
  }
71
72
  BusinessUtils.getMonths = getMonths;
73
+ /**
74
+ * Is asset unit
75
+ * @param unit Product unit
76
+ * @returns Result
77
+ */
78
+ function isAssetUnit(unit) {
79
+ return (unit === ProductUnit_1.AssetUnits.TIME ||
80
+ unit === ProductUnit_1.AssetUnits.MONEY ||
81
+ (unit >= ProductUnit_1.AssetUnits.HOUR && unit <= ProductUnit_1.AssetUnits.HALFYEAR));
82
+ }
83
+ BusinessUtils.isAssetUnit = isAssetUnit;
72
84
  /**
73
85
  * Check if the item is a custom culture data
74
86
  * @param item Item to check
@@ -66,7 +66,7 @@ export declare enum ProductOtherUnit {
66
66
  /**
67
67
  * Product units enum
68
68
  * Repeat options take range 10 - 39
69
- * @see com.etsoo.CoreFramework.Business.ProductUnit
69
+ * C#, com.etsoo.CoreFramework.Business.ProductUnit
70
70
  */
71
71
  export declare const ProductUnit: {
72
72
  [x: number]: string;
@@ -73,7 +73,7 @@ var ProductOtherUnit;
73
73
  /**
74
74
  * Product units enum
75
75
  * Repeat options take range 10 - 39
76
- * @see com.etsoo.CoreFramework.Business.ProductUnit
76
+ * C#, com.etsoo.CoreFramework.Business.ProductUnit
77
77
  */
78
78
  exports.ProductUnit = {
79
79
  ...ProductBaseUnit,
@@ -95,6 +95,7 @@
95
95
  "item": "Item",
96
96
  "itemExists": "'{0}' already exists",
97
97
  "jsonData": "Extended data",
98
+ "jsonDataArrayError": "JSON format error, must be an array",
98
99
  "jsonDataError": "JSON format error",
99
100
  "key": "Key",
100
101
  "keywords": "Keywords",
@@ -239,7 +240,7 @@
239
240
  "unitWEEK": "Week",
240
241
  "unitFORTNIGHT": "Fortnight",
241
242
  "unitFOURWEEK": "4-week",
242
- "unitMONEY": "Money",
243
+ "unitMONEY": "Money card",
243
244
  "unitMONTH": "Month",
244
245
  "unitBIMONTH": "2-month",
245
246
  "unitQUATER": "Quater",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "g",
248
249
  "unitJIN": "½Kg",
249
250
  "unitKILOGRAM": "Kg",
250
- "unitTIME": "Time",
251
+ "unitTIME": "Times card",
251
252
  "unitTON": "Ton",
252
253
  "unitM3": "m3",
253
254
  "update": "Update",
@@ -95,6 +95,7 @@
95
95
  "item": "项目",
96
96
  "itemExists": "'{0}'已经存在",
97
97
  "jsonData": "扩展数据",
98
+ "jsonDataArrayError": "JSON格式错误,必须是一个数组",
98
99
  "jsonDataError": "JSON格式错误",
99
100
  "key": "键",
100
101
  "keywords": "关键词",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "克",
248
249
  "unitJIN": "斤",
249
250
  "unitKILOGRAM": "公斤",
250
- "unitTIME": "",
251
+ "unitTIME": "次卡",
251
252
  "unitTON": "吨",
252
253
  "unitM3": "立方米",
253
254
  "update": "更新",
@@ -93,8 +93,9 @@
93
93
  "imageSizeTooSmall": "圖片尺寸過小",
94
94
  "info": "信息",
95
95
  "item": "項目",
96
- "itemExists": "'{0}'已经存在",
96
+ "itemExists": "'{0}'已經存在",
97
97
  "jsonData": "擴充資料",
98
+ "jsonDataArrayError": "JSON格式錯誤,必須是一個數組",
98
99
  "jsonDataError": "JSON格式錯誤",
99
100
  "key": "鍵",
100
101
  "keywords": "關鍵詞",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "克",
248
249
  "unitJIN": "斤",
249
250
  "unitKILOGRAM": "公斤",
250
- "unitTIME": "",
251
+ "unitTIME": "次卡",
251
252
  "unitTON": "噸",
252
253
  "unitM3": "立方米",
253
254
  "update": "更新",
@@ -1,6 +1,7 @@
1
1
  import { DataTypes, IdType, ListType } from "@etsoo/shared";
2
2
  import { CustomCultureData } from "../def/CustomCulture";
3
3
  import { QueryRQ } from "../api/rq/QueryRQ";
4
+ import { AssetUnits, ProductUnit } from "./ProductUnit";
4
5
  /**
5
6
  * Business utils
6
7
  */
@@ -32,6 +33,12 @@ export declare namespace BusinessUtils {
32
33
  * @returns 12 months
33
34
  */
34
35
  function getMonths(monthLabels: string[], startMonth?: number): ListType[];
36
+ /**
37
+ * Is asset unit
38
+ * @param unit Product unit
39
+ * @returns Result
40
+ */
41
+ function isAssetUnit(unit: ProductUnit): unit is AssetUnits;
35
42
  /**
36
43
  * Check if the item is a custom culture data
37
44
  * @param item Item to check
@@ -1,3 +1,4 @@
1
+ import { AssetUnits } from "./ProductUnit";
1
2
  /**
2
3
  * Business utils
3
4
  */
@@ -66,6 +67,17 @@ export var BusinessUtils;
66
67
  return months;
67
68
  }
68
69
  BusinessUtils.getMonths = getMonths;
70
+ /**
71
+ * Is asset unit
72
+ * @param unit Product unit
73
+ * @returns Result
74
+ */
75
+ function isAssetUnit(unit) {
76
+ return (unit === AssetUnits.TIME ||
77
+ unit === AssetUnits.MONEY ||
78
+ (unit >= AssetUnits.HOUR && unit <= AssetUnits.HALFYEAR));
79
+ }
80
+ BusinessUtils.isAssetUnit = isAssetUnit;
69
81
  /**
70
82
  * Check if the item is a custom culture data
71
83
  * @param item Item to check
@@ -66,7 +66,7 @@ export declare enum ProductOtherUnit {
66
66
  /**
67
67
  * Product units enum
68
68
  * Repeat options take range 10 - 39
69
- * @see com.etsoo.CoreFramework.Business.ProductUnit
69
+ * C#, com.etsoo.CoreFramework.Business.ProductUnit
70
70
  */
71
71
  export declare const ProductUnit: {
72
72
  [x: number]: string;
@@ -70,7 +70,7 @@ export var ProductOtherUnit;
70
70
  /**
71
71
  * Product units enum
72
72
  * Repeat options take range 10 - 39
73
- * @see com.etsoo.CoreFramework.Business.ProductUnit
73
+ * C#, com.etsoo.CoreFramework.Business.ProductUnit
74
74
  */
75
75
  export const ProductUnit = {
76
76
  ...ProductBaseUnit,
@@ -95,6 +95,7 @@
95
95
  "item": "Item",
96
96
  "itemExists": "'{0}' already exists",
97
97
  "jsonData": "Extended data",
98
+ "jsonDataArrayError": "JSON format error, must be an array",
98
99
  "jsonDataError": "JSON format error",
99
100
  "key": "Key",
100
101
  "keywords": "Keywords",
@@ -239,7 +240,7 @@
239
240
  "unitWEEK": "Week",
240
241
  "unitFORTNIGHT": "Fortnight",
241
242
  "unitFOURWEEK": "4-week",
242
- "unitMONEY": "Money",
243
+ "unitMONEY": "Money card",
243
244
  "unitMONTH": "Month",
244
245
  "unitBIMONTH": "2-month",
245
246
  "unitQUATER": "Quater",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "g",
248
249
  "unitJIN": "½Kg",
249
250
  "unitKILOGRAM": "Kg",
250
- "unitTIME": "Time",
251
+ "unitTIME": "Times card",
251
252
  "unitTON": "Ton",
252
253
  "unitM3": "m3",
253
254
  "update": "Update",
@@ -95,6 +95,7 @@
95
95
  "item": "项目",
96
96
  "itemExists": "'{0}'已经存在",
97
97
  "jsonData": "扩展数据",
98
+ "jsonDataArrayError": "JSON格式错误,必须是一个数组",
98
99
  "jsonDataError": "JSON格式错误",
99
100
  "key": "键",
100
101
  "keywords": "关键词",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "克",
248
249
  "unitJIN": "斤",
249
250
  "unitKILOGRAM": "公斤",
250
- "unitTIME": "",
251
+ "unitTIME": "次卡",
251
252
  "unitTON": "吨",
252
253
  "unitM3": "立方米",
253
254
  "update": "更新",
@@ -93,8 +93,9 @@
93
93
  "imageSizeTooSmall": "圖片尺寸過小",
94
94
  "info": "信息",
95
95
  "item": "項目",
96
- "itemExists": "'{0}'已经存在",
96
+ "itemExists": "'{0}'已經存在",
97
97
  "jsonData": "擴充資料",
98
+ "jsonDataArrayError": "JSON格式錯誤,必須是一個數組",
98
99
  "jsonDataError": "JSON格式錯誤",
99
100
  "key": "鍵",
100
101
  "keywords": "關鍵詞",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "克",
248
249
  "unitJIN": "斤",
249
250
  "unitKILOGRAM": "公斤",
250
- "unitTIME": "",
251
+ "unitTIME": "次卡",
251
252
  "unitTON": "噸",
252
253
  "unitM3": "立方米",
253
254
  "update": "更新",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.6.52",
3
+ "version": "1.6.54",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -41,15 +41,15 @@
41
41
  "crypto-js": "^4.2.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@babel/cli": "^7.28.3",
45
- "@babel/core": "^7.28.5",
46
- "@babel/plugin-transform-runtime": "^7.28.5",
47
- "@babel/preset-env": "^7.28.5",
48
- "@babel/runtime-corejs3": "^7.28.4",
44
+ "@babel/cli": "^7.28.6",
45
+ "@babel/core": "^7.29.0",
46
+ "@babel/plugin-transform-runtime": "^7.29.0",
47
+ "@babel/preset-env": "^7.29.0",
48
+ "@babel/runtime-corejs3": "^7.29.0",
49
49
  "@types/crypto-js": "^4.2.2",
50
- "@vitejs/plugin-react": "^5.1.2",
51
- "jsdom": "^27.4.0",
50
+ "@vitejs/plugin-react": "^5.1.4",
51
+ "jsdom": "^28.1.0",
52
52
  "typescript": "^5.9.3",
53
- "vitest": "^4.0.16"
53
+ "vitest": "^4.0.18"
54
54
  }
55
55
  }
@@ -1,6 +1,7 @@
1
1
  import { DataTypes, IdType, ListType } from "@etsoo/shared";
2
2
  import { CustomCultureData } from "../def/CustomCulture";
3
3
  import { QueryRQ } from "../api/rq/QueryRQ";
4
+ import { AssetUnits, ProductUnit } from "./ProductUnit";
4
5
 
5
6
  /**
6
7
  * Business utils
@@ -80,6 +81,19 @@ export namespace BusinessUtils {
80
81
  return months;
81
82
  }
82
83
 
84
+ /**
85
+ * Is asset unit
86
+ * @param unit Product unit
87
+ * @returns Result
88
+ */
89
+ export function isAssetUnit(unit: ProductUnit): unit is AssetUnits {
90
+ return (
91
+ unit === AssetUnits.TIME ||
92
+ unit === AssetUnits.MONEY ||
93
+ (unit >= AssetUnits.HOUR && unit <= AssetUnits.HALFYEAR)
94
+ );
95
+ }
96
+
83
97
  /**
84
98
  * Check if the item is a custom culture data
85
99
  * @param item Item to check
@@ -76,7 +76,7 @@ export enum ProductOtherUnit {
76
76
  /**
77
77
  * Product units enum
78
78
  * Repeat options take range 10 - 39
79
- * @see com.etsoo.CoreFramework.Business.ProductUnit
79
+ * C#, com.etsoo.CoreFramework.Business.ProductUnit
80
80
  */
81
81
  export const ProductUnit = {
82
82
  ...ProductBaseUnit,
package/src/i18n/en.json CHANGED
@@ -95,6 +95,7 @@
95
95
  "item": "Item",
96
96
  "itemExists": "'{0}' already exists",
97
97
  "jsonData": "Extended data",
98
+ "jsonDataArrayError": "JSON format error, must be an array",
98
99
  "jsonDataError": "JSON format error",
99
100
  "key": "Key",
100
101
  "keywords": "Keywords",
@@ -239,7 +240,7 @@
239
240
  "unitWEEK": "Week",
240
241
  "unitFORTNIGHT": "Fortnight",
241
242
  "unitFOURWEEK": "4-week",
242
- "unitMONEY": "Money",
243
+ "unitMONEY": "Money card",
243
244
  "unitMONTH": "Month",
244
245
  "unitBIMONTH": "2-month",
245
246
  "unitQUATER": "Quater",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "g",
248
249
  "unitJIN": "½Kg",
249
250
  "unitKILOGRAM": "Kg",
250
- "unitTIME": "Time",
251
+ "unitTIME": "Times card",
251
252
  "unitTON": "Ton",
252
253
  "unitM3": "m3",
253
254
  "update": "Update",
@@ -95,6 +95,7 @@
95
95
  "item": "项目",
96
96
  "itemExists": "'{0}'已经存在",
97
97
  "jsonData": "扩展数据",
98
+ "jsonDataArrayError": "JSON格式错误,必须是一个数组",
98
99
  "jsonDataError": "JSON格式错误",
99
100
  "key": "键",
100
101
  "keywords": "关键词",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "克",
248
249
  "unitJIN": "斤",
249
250
  "unitKILOGRAM": "公斤",
250
- "unitTIME": "",
251
+ "unitTIME": "次卡",
251
252
  "unitTON": "吨",
252
253
  "unitM3": "立方米",
253
254
  "update": "更新",
@@ -93,8 +93,9 @@
93
93
  "imageSizeTooSmall": "圖片尺寸過小",
94
94
  "info": "信息",
95
95
  "item": "項目",
96
- "itemExists": "'{0}'已经存在",
96
+ "itemExists": "'{0}'已經存在",
97
97
  "jsonData": "擴充資料",
98
+ "jsonDataArrayError": "JSON格式錯誤,必須是一個數組",
98
99
  "jsonDataError": "JSON格式錯誤",
99
100
  "key": "鍵",
100
101
  "keywords": "關鍵詞",
@@ -247,7 +248,7 @@
247
248
  "unitGRAM": "克",
248
249
  "unitJIN": "斤",
249
250
  "unitKILOGRAM": "公斤",
250
- "unitTIME": "",
251
+ "unitTIME": "次卡",
251
252
  "unitTON": "噸",
252
253
  "unitM3": "立方米",
253
254
  "update": "更新",