@etsoo/appscript 1.6.51 → 1.6.53
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/business/BusinessUtils.d.ts +7 -0
- package/lib/cjs/business/BusinessUtils.js +12 -0
- package/lib/cjs/business/ProductUnit.d.ts +1 -1
- package/lib/cjs/business/ProductUnit.js +1 -1
- package/lib/cjs/i18n/en.json +2 -0
- package/lib/cjs/i18n/zh-Hans.json +2 -0
- package/lib/cjs/i18n/zh-Hant.json +2 -0
- package/lib/mjs/business/BusinessUtils.d.ts +7 -0
- package/lib/mjs/business/BusinessUtils.js +12 -0
- package/lib/mjs/business/ProductUnit.d.ts +1 -1
- package/lib/mjs/business/ProductUnit.js +1 -1
- package/lib/mjs/i18n/en.json +2 -0
- package/lib/mjs/i18n/zh-Hans.json +2 -0
- package/lib/mjs/i18n/zh-Hant.json +2 -0
- package/package.json +1 -1
- package/src/business/BusinessUtils.ts +14 -0
- package/src/business/ProductUnit.ts +1 -1
- package/src/i18n/en.json +2 -0
- package/src/i18n/zh-Hans.json +2 -0
- package/src/i18n/zh-Hant.json +2 -0
|
@@ -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
|
-
*
|
|
69
|
+
* C#, com.etsoo.CoreFramework.Business.ProductUnit
|
|
70
70
|
*/
|
|
71
71
|
export declare const ProductUnit: {
|
|
72
72
|
[x: number]: string;
|
package/lib/cjs/i18n/en.json
CHANGED
|
@@ -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
|
-
*
|
|
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
|
-
*
|
|
73
|
+
* C#, com.etsoo.CoreFramework.Business.ProductUnit
|
|
74
74
|
*/
|
|
75
75
|
export const ProductUnit = {
|
|
76
76
|
...ProductBaseUnit,
|
package/lib/mjs/i18n/en.json
CHANGED
package/package.json
CHANGED
|
@@ -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
|
-
*
|
|
79
|
+
* C#, com.etsoo.CoreFramework.Business.ProductUnit
|
|
80
80
|
*/
|
|
81
81
|
export const ProductUnit = {
|
|
82
82
|
...ProductBaseUnit,
|
package/src/i18n/en.json
CHANGED
package/src/i18n/zh-Hans.json
CHANGED