@etsoo/appscript 1.0.89 → 1.0.90
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/ProductUnit.d.ts +18 -0
- package/lib/cjs/business/ProductUnit.js +70 -0
- package/lib/cjs/business/Utils.d.ts +15 -0
- package/lib/cjs/business/Utils.js +23 -0
- package/lib/mjs/business/ProductUnit.d.ts +18 -0
- package/lib/mjs/business/ProductUnit.js +67 -0
- package/lib/mjs/business/Utils.d.ts +15 -0
- package/lib/mjs/business/Utils.js +20 -0
- package/package.json +1 -1
- package/src/business/ProductUnit.ts +77 -0
- package/src/business/Utils.ts +19 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product units enum
|
|
3
|
+
* See com.etsoo.CoreFramework.Business.ProductUnit
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ProductUnit {
|
|
6
|
+
PC = 0,
|
|
7
|
+
SET = 1,
|
|
8
|
+
YEAR = 10,
|
|
9
|
+
QUATER = 11,
|
|
10
|
+
MONTH = 12,
|
|
11
|
+
FORNIGHT = 13,
|
|
12
|
+
WEEK = 14,
|
|
13
|
+
DAY = 15,
|
|
14
|
+
HOUR = 16,
|
|
15
|
+
TON = 31,
|
|
16
|
+
KILOGRAM = 32,
|
|
17
|
+
GRAM = 33
|
|
18
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductUnit = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Product units enum
|
|
6
|
+
* See com.etsoo.CoreFramework.Business.ProductUnit
|
|
7
|
+
*/
|
|
8
|
+
var ProductUnit;
|
|
9
|
+
(function (ProductUnit) {
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Picese
|
|
12
|
+
/// 件
|
|
13
|
+
/// </summary>
|
|
14
|
+
ProductUnit[ProductUnit["PC"] = 0] = "PC";
|
|
15
|
+
/// <summary>
|
|
16
|
+
/// Set
|
|
17
|
+
/// 套
|
|
18
|
+
/// </summary>
|
|
19
|
+
ProductUnit[ProductUnit["SET"] = 1] = "SET";
|
|
20
|
+
/// <summary>
|
|
21
|
+
/// Year
|
|
22
|
+
/// 年
|
|
23
|
+
/// </summary>
|
|
24
|
+
ProductUnit[ProductUnit["YEAR"] = 10] = "YEAR";
|
|
25
|
+
/// <summary>
|
|
26
|
+
/// Quater
|
|
27
|
+
/// 季
|
|
28
|
+
/// </summary>
|
|
29
|
+
ProductUnit[ProductUnit["QUATER"] = 11] = "QUATER";
|
|
30
|
+
/// <summary>
|
|
31
|
+
/// Month
|
|
32
|
+
/// 月
|
|
33
|
+
/// </summary>
|
|
34
|
+
ProductUnit[ProductUnit["MONTH"] = 12] = "MONTH";
|
|
35
|
+
/// <summary>
|
|
36
|
+
/// Fortnight
|
|
37
|
+
/// 两周
|
|
38
|
+
/// </summary>
|
|
39
|
+
ProductUnit[ProductUnit["FORNIGHT"] = 13] = "FORNIGHT";
|
|
40
|
+
/// <summary>
|
|
41
|
+
/// Week
|
|
42
|
+
/// 周
|
|
43
|
+
/// </summary>
|
|
44
|
+
ProductUnit[ProductUnit["WEEK"] = 14] = "WEEK";
|
|
45
|
+
/// <summary>
|
|
46
|
+
/// Day
|
|
47
|
+
/// 天
|
|
48
|
+
/// </summary>
|
|
49
|
+
ProductUnit[ProductUnit["DAY"] = 15] = "DAY";
|
|
50
|
+
/// <summary>
|
|
51
|
+
/// Hour
|
|
52
|
+
/// 小时
|
|
53
|
+
/// </summary>
|
|
54
|
+
ProductUnit[ProductUnit["HOUR"] = 16] = "HOUR";
|
|
55
|
+
/// <summary>
|
|
56
|
+
/// Ton
|
|
57
|
+
/// 吨
|
|
58
|
+
/// </summary>
|
|
59
|
+
ProductUnit[ProductUnit["TON"] = 31] = "TON";
|
|
60
|
+
/// <summary>
|
|
61
|
+
/// Kilogram
|
|
62
|
+
/// 千克
|
|
63
|
+
/// </summary>
|
|
64
|
+
ProductUnit[ProductUnit["KILOGRAM"] = 32] = "KILOGRAM";
|
|
65
|
+
/// <summary>
|
|
66
|
+
/// Gram
|
|
67
|
+
/// 克
|
|
68
|
+
/// </summary>
|
|
69
|
+
ProductUnit[ProductUnit["GRAM"] = 33] = "GRAM";
|
|
70
|
+
})(ProductUnit = exports.ProductUnit || (exports.ProductUnit = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICultureGet } from '../state/Culture';
|
|
2
|
+
import { ProductUnit } from './ProductUnit';
|
|
3
|
+
/**
|
|
4
|
+
* Business utils
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace Utils {
|
|
7
|
+
/**
|
|
8
|
+
* Get product unit's label
|
|
9
|
+
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
10
|
+
* @param unit Unit
|
|
11
|
+
* @param func Label delegate
|
|
12
|
+
* @returns Label
|
|
13
|
+
*/
|
|
14
|
+
function getUnitLabel(unit: ProductUnit, func: ICultureGet): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Utils = void 0;
|
|
4
|
+
const ProductUnit_1 = require("./ProductUnit");
|
|
5
|
+
/**
|
|
6
|
+
* Business utils
|
|
7
|
+
*/
|
|
8
|
+
var Utils;
|
|
9
|
+
(function (Utils) {
|
|
10
|
+
/**
|
|
11
|
+
* Get product unit's label
|
|
12
|
+
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
13
|
+
* @param unit Unit
|
|
14
|
+
* @param func Label delegate
|
|
15
|
+
* @returns Label
|
|
16
|
+
*/
|
|
17
|
+
function getUnitLabel(unit, func) {
|
|
18
|
+
var _a;
|
|
19
|
+
const key = ProductUnit_1.ProductUnit[unit];
|
|
20
|
+
return (_a = func('unit' + key)) !== null && _a !== void 0 ? _a : key;
|
|
21
|
+
}
|
|
22
|
+
Utils.getUnitLabel = getUnitLabel;
|
|
23
|
+
})(Utils = exports.Utils || (exports.Utils = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product units enum
|
|
3
|
+
* See com.etsoo.CoreFramework.Business.ProductUnit
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ProductUnit {
|
|
6
|
+
PC = 0,
|
|
7
|
+
SET = 1,
|
|
8
|
+
YEAR = 10,
|
|
9
|
+
QUATER = 11,
|
|
10
|
+
MONTH = 12,
|
|
11
|
+
FORNIGHT = 13,
|
|
12
|
+
WEEK = 14,
|
|
13
|
+
DAY = 15,
|
|
14
|
+
HOUR = 16,
|
|
15
|
+
TON = 31,
|
|
16
|
+
KILOGRAM = 32,
|
|
17
|
+
GRAM = 33
|
|
18
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product units enum
|
|
3
|
+
* See com.etsoo.CoreFramework.Business.ProductUnit
|
|
4
|
+
*/
|
|
5
|
+
export var ProductUnit;
|
|
6
|
+
(function (ProductUnit) {
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Picese
|
|
9
|
+
/// 件
|
|
10
|
+
/// </summary>
|
|
11
|
+
ProductUnit[ProductUnit["PC"] = 0] = "PC";
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Set
|
|
14
|
+
/// 套
|
|
15
|
+
/// </summary>
|
|
16
|
+
ProductUnit[ProductUnit["SET"] = 1] = "SET";
|
|
17
|
+
/// <summary>
|
|
18
|
+
/// Year
|
|
19
|
+
/// 年
|
|
20
|
+
/// </summary>
|
|
21
|
+
ProductUnit[ProductUnit["YEAR"] = 10] = "YEAR";
|
|
22
|
+
/// <summary>
|
|
23
|
+
/// Quater
|
|
24
|
+
/// 季
|
|
25
|
+
/// </summary>
|
|
26
|
+
ProductUnit[ProductUnit["QUATER"] = 11] = "QUATER";
|
|
27
|
+
/// <summary>
|
|
28
|
+
/// Month
|
|
29
|
+
/// 月
|
|
30
|
+
/// </summary>
|
|
31
|
+
ProductUnit[ProductUnit["MONTH"] = 12] = "MONTH";
|
|
32
|
+
/// <summary>
|
|
33
|
+
/// Fortnight
|
|
34
|
+
/// 两周
|
|
35
|
+
/// </summary>
|
|
36
|
+
ProductUnit[ProductUnit["FORNIGHT"] = 13] = "FORNIGHT";
|
|
37
|
+
/// <summary>
|
|
38
|
+
/// Week
|
|
39
|
+
/// 周
|
|
40
|
+
/// </summary>
|
|
41
|
+
ProductUnit[ProductUnit["WEEK"] = 14] = "WEEK";
|
|
42
|
+
/// <summary>
|
|
43
|
+
/// Day
|
|
44
|
+
/// 天
|
|
45
|
+
/// </summary>
|
|
46
|
+
ProductUnit[ProductUnit["DAY"] = 15] = "DAY";
|
|
47
|
+
/// <summary>
|
|
48
|
+
/// Hour
|
|
49
|
+
/// 小时
|
|
50
|
+
/// </summary>
|
|
51
|
+
ProductUnit[ProductUnit["HOUR"] = 16] = "HOUR";
|
|
52
|
+
/// <summary>
|
|
53
|
+
/// Ton
|
|
54
|
+
/// 吨
|
|
55
|
+
/// </summary>
|
|
56
|
+
ProductUnit[ProductUnit["TON"] = 31] = "TON";
|
|
57
|
+
/// <summary>
|
|
58
|
+
/// Kilogram
|
|
59
|
+
/// 千克
|
|
60
|
+
/// </summary>
|
|
61
|
+
ProductUnit[ProductUnit["KILOGRAM"] = 32] = "KILOGRAM";
|
|
62
|
+
/// <summary>
|
|
63
|
+
/// Gram
|
|
64
|
+
/// 克
|
|
65
|
+
/// </summary>
|
|
66
|
+
ProductUnit[ProductUnit["GRAM"] = 33] = "GRAM";
|
|
67
|
+
})(ProductUnit || (ProductUnit = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICultureGet } from '../state/Culture';
|
|
2
|
+
import { ProductUnit } from './ProductUnit';
|
|
3
|
+
/**
|
|
4
|
+
* Business utils
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace Utils {
|
|
7
|
+
/**
|
|
8
|
+
* Get product unit's label
|
|
9
|
+
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
10
|
+
* @param unit Unit
|
|
11
|
+
* @param func Label delegate
|
|
12
|
+
* @returns Label
|
|
13
|
+
*/
|
|
14
|
+
function getUnitLabel(unit: ProductUnit, func: ICultureGet): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ProductUnit } from './ProductUnit';
|
|
2
|
+
/**
|
|
3
|
+
* Business utils
|
|
4
|
+
*/
|
|
5
|
+
export var Utils;
|
|
6
|
+
(function (Utils) {
|
|
7
|
+
/**
|
|
8
|
+
* Get product unit's label
|
|
9
|
+
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
10
|
+
* @param unit Unit
|
|
11
|
+
* @param func Label delegate
|
|
12
|
+
* @returns Label
|
|
13
|
+
*/
|
|
14
|
+
function getUnitLabel(unit, func) {
|
|
15
|
+
var _a;
|
|
16
|
+
const key = ProductUnit[unit];
|
|
17
|
+
return (_a = func('unit' + key)) !== null && _a !== void 0 ? _a : key;
|
|
18
|
+
}
|
|
19
|
+
Utils.getUnitLabel = getUnitLabel;
|
|
20
|
+
})(Utils || (Utils = {}));
|
package/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product units enum
|
|
3
|
+
* See com.etsoo.CoreFramework.Business.ProductUnit
|
|
4
|
+
*/
|
|
5
|
+
export enum ProductUnit {
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Picese
|
|
8
|
+
/// 件
|
|
9
|
+
/// </summary>
|
|
10
|
+
PC = 0,
|
|
11
|
+
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Set
|
|
14
|
+
/// 套
|
|
15
|
+
/// </summary>
|
|
16
|
+
SET = 1,
|
|
17
|
+
|
|
18
|
+
/// <summary>
|
|
19
|
+
/// Year
|
|
20
|
+
/// 年
|
|
21
|
+
/// </summary>
|
|
22
|
+
YEAR = 10,
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
/// Quater
|
|
26
|
+
/// 季
|
|
27
|
+
/// </summary>
|
|
28
|
+
QUATER = 11,
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
/// Month
|
|
32
|
+
/// 月
|
|
33
|
+
/// </summary>
|
|
34
|
+
MONTH = 12,
|
|
35
|
+
|
|
36
|
+
/// <summary>
|
|
37
|
+
/// Fortnight
|
|
38
|
+
/// 两周
|
|
39
|
+
/// </summary>
|
|
40
|
+
FORNIGHT = 13,
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
/// Week
|
|
44
|
+
/// 周
|
|
45
|
+
/// </summary>
|
|
46
|
+
WEEK = 14,
|
|
47
|
+
|
|
48
|
+
/// <summary>
|
|
49
|
+
/// Day
|
|
50
|
+
/// 天
|
|
51
|
+
/// </summary>
|
|
52
|
+
DAY = 15,
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
/// Hour
|
|
56
|
+
/// 小时
|
|
57
|
+
/// </summary>
|
|
58
|
+
HOUR = 16,
|
|
59
|
+
|
|
60
|
+
/// <summary>
|
|
61
|
+
/// Ton
|
|
62
|
+
/// 吨
|
|
63
|
+
/// </summary>
|
|
64
|
+
TON = 31,
|
|
65
|
+
|
|
66
|
+
/// <summary>
|
|
67
|
+
/// Kilogram
|
|
68
|
+
/// 千克
|
|
69
|
+
/// </summary>
|
|
70
|
+
KILOGRAM = 32,
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
/// Gram
|
|
74
|
+
/// 克
|
|
75
|
+
/// </summary>
|
|
76
|
+
GRAM = 33
|
|
77
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICultureGet } from '../state/Culture';
|
|
2
|
+
import { ProductUnit } from './ProductUnit';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Business utils
|
|
6
|
+
*/
|
|
7
|
+
export namespace Utils {
|
|
8
|
+
/**
|
|
9
|
+
* Get product unit's label
|
|
10
|
+
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
11
|
+
* @param unit Unit
|
|
12
|
+
* @param func Label delegate
|
|
13
|
+
* @returns Label
|
|
14
|
+
*/
|
|
15
|
+
export function getUnitLabel(unit: ProductUnit, func: ICultureGet) {
|
|
16
|
+
const key = ProductUnit[unit];
|
|
17
|
+
return func('unit' + key) ?? key;
|
|
18
|
+
}
|
|
19
|
+
}
|