@etsoo/appscript 1.2.24 → 1.2.25
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/__tests__/app/CoreApp.ts +15 -0
- package/lib/cjs/app/CoreApp.d.ts +13 -0
- package/lib/cjs/app/CoreApp.js +10 -0
- package/lib/cjs/business/BusinessUtils.d.ts +21 -2
- package/lib/cjs/business/BusinessUtils.js +32 -6
- package/lib/cjs/business/ProductUnit.d.ts +47 -45
- package/lib/cjs/business/ProductUnit.js +36 -48
- package/lib/cjs/business/RepeatOption.d.ts +56 -0
- package/lib/cjs/business/RepeatOption.js +60 -0
- package/lib/cjs/i18n/en-US.json +17 -0
- package/lib/cjs/i18n/zh-CN.json +18 -0
- package/lib/cjs/i18n/zh-HK.json +17 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/mjs/app/CoreApp.d.ts +13 -0
- package/lib/mjs/app/CoreApp.js +10 -0
- package/lib/mjs/business/BusinessUtils.d.ts +21 -2
- package/lib/mjs/business/BusinessUtils.js +32 -6
- package/lib/mjs/business/ProductUnit.d.ts +47 -45
- package/lib/mjs/business/ProductUnit.js +35 -47
- package/lib/mjs/business/RepeatOption.d.ts +56 -0
- package/lib/mjs/business/RepeatOption.js +57 -0
- package/lib/mjs/i18n/en-US.json +17 -0
- package/lib/mjs/i18n/zh-CN.json +18 -0
- package/lib/mjs/i18n/zh-HK.json +17 -0
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +1 -0
- package/package.json +6 -6
- package/src/app/CoreApp.ts +18 -0
- package/src/business/BusinessUtils.ts +66 -7
- package/src/business/ProductUnit.ts +35 -51
- package/src/business/RepeatOption.ts +65 -0
- package/src/i18n/en-US.json +17 -0
- package/src/i18n/zh-CN.json +18 -0
- package/src/i18n/zh-HK.json +17 -0
- package/src/index.ts +1 -0
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from '@etsoo/notificationbase';
|
|
9
9
|
import { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
|
|
10
10
|
import { DataTypes, DomUtils, Utils, WindowStorage } from '@etsoo/shared';
|
|
11
|
+
import { BusinessUtils } from '../../src';
|
|
11
12
|
import { AddressUtils } from '../../src/address/AddressUtils';
|
|
12
13
|
import { IAppSettings } from '../../src/app/AppSettings';
|
|
13
14
|
import { CoreApp } from '../../src/app/CoreApp';
|
|
@@ -154,3 +155,17 @@ test('Tests for initCallUpdateLocal', () => {
|
|
|
154
155
|
);
|
|
155
156
|
expect(passphrase).not.toBeNull();
|
|
156
157
|
});
|
|
158
|
+
|
|
159
|
+
test('Tests for getUnitLabel', () => {
|
|
160
|
+
expect(app.getUnitLabel(12, true)).toBe('每年');
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test('Tests for getRepeatOptions', () => {
|
|
164
|
+
const options = BusinessUtils.getRepeatOptions(app.labelDelegate, [
|
|
165
|
+
'MONTH',
|
|
166
|
+
'QUATER',
|
|
167
|
+
'YEAR'
|
|
168
|
+
]);
|
|
169
|
+
|
|
170
|
+
expect(options[2]).toStrictEqual({ id: 12, label: '每年' });
|
|
171
|
+
});
|
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { INotifier, NotificationAlign, NotificationCallProps, NotificationConten
|
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
3
|
import { DataTypes, DateUtils, IStorage } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
|
+
import { ProductUnit } from '../business/ProductUnit';
|
|
5
6
|
import { IdLabelDto } from '../dto/IdLabelDto';
|
|
6
7
|
import { InitCallDto } from '../dto/InitCallDto';
|
|
7
8
|
import { IActionResult } from '../result/IActionResult';
|
|
@@ -255,6 +256,12 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
|
|
|
255
256
|
* @returns Time zone
|
|
256
257
|
*/
|
|
257
258
|
getTimeZone(): string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* Get product unit and repeat option label
|
|
261
|
+
* @param unit Product unit or repeat option
|
|
262
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
263
|
+
*/
|
|
264
|
+
getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string;
|
|
258
265
|
/**
|
|
259
266
|
* Hash message, SHA3 or HmacSHA512, 512 as Base64
|
|
260
267
|
* https://cryptojs.gitbook.io/docs/
|
|
@@ -646,6 +653,12 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
646
653
|
* @returns Time zone
|
|
647
654
|
*/
|
|
648
655
|
getTimeZone(): string | undefined;
|
|
656
|
+
/**
|
|
657
|
+
* Get product unit and repeat option label
|
|
658
|
+
* @param unit Product unit or repeat option
|
|
659
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
660
|
+
*/
|
|
661
|
+
getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string;
|
|
649
662
|
/**
|
|
650
663
|
* Hash message, SHA3 or HmacSHA512, 512 as Base64
|
|
651
664
|
* https://cryptojs.gitbook.io/docs/
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -743,6 +743,16 @@ class CoreApp {
|
|
|
743
743
|
// settings.timeZone = Utils.getTimeZone()
|
|
744
744
|
return (_a = this.settings.timeZone) !== null && _a !== void 0 ? _a : (_b = this.ipData) === null || _b === void 0 ? void 0 : _b.timezone;
|
|
745
745
|
}
|
|
746
|
+
/**
|
|
747
|
+
* Get product unit and repeat option label
|
|
748
|
+
* @param unit Product unit or repeat option
|
|
749
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
750
|
+
*/
|
|
751
|
+
getUnitLabel(unit, isJoined) {
|
|
752
|
+
if (unit == null)
|
|
753
|
+
return '';
|
|
754
|
+
return BusinessUtils_1.BusinessUtils.getUnitLabel(unit, this.labelDelegate, isJoined);
|
|
755
|
+
}
|
|
746
756
|
/**
|
|
747
757
|
* Hash message, SHA3 or HmacSHA512, 512 as Base64
|
|
748
758
|
* https://cryptojs.gitbook.io/docs/
|
|
@@ -16,7 +16,7 @@ export declare namespace BusinessUtils {
|
|
|
16
16
|
function addIdLabelBlankItem<T extends DataTypes.IdType = number>(input: IdLabelDto<T>[], copy?: boolean): IdLabelDto<T>[];
|
|
17
17
|
/**
|
|
18
18
|
* Get product unit's label
|
|
19
|
-
* Please define the label in culture with key '
|
|
19
|
+
* Please define the label in culture with key 'statusNormal' for Normal status
|
|
20
20
|
* @param unit Unit
|
|
21
21
|
* @param func Label delegate
|
|
22
22
|
* @returns Label
|
|
@@ -38,13 +38,32 @@ export declare namespace BusinessUtils {
|
|
|
38
38
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
39
39
|
* @param unit Unit
|
|
40
40
|
* @param func Label delegate
|
|
41
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
41
42
|
* @returns Label
|
|
42
43
|
*/
|
|
43
|
-
function getUnitLabel(unit: ProductUnit, func: ICultureGet): string;
|
|
44
|
+
function getUnitLabel(unit: ProductUnit, func: ICultureGet, isJoined?: boolean): string;
|
|
44
45
|
/**
|
|
45
46
|
* Get all product units
|
|
46
47
|
* @param func Label delegate
|
|
47
48
|
* @returns Units
|
|
48
49
|
*/
|
|
49
50
|
function getUnits(func: ICultureGet): IdLabelDto[];
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* Get all product units
|
|
54
|
+
* @param func Label delegate
|
|
55
|
+
* @param options Define the order and limit the items
|
|
56
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
57
|
+
* @returns Units
|
|
58
|
+
*/
|
|
59
|
+
function getUnits(func: ICultureGet, options?: string[], isJoined?: boolean): IdLabelDto[];
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* Get all repeat options
|
|
63
|
+
* @param func Label delegate
|
|
64
|
+
* @param options Define the order and limit the items
|
|
65
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
66
|
+
* @returns Units
|
|
67
|
+
*/
|
|
68
|
+
function getRepeatOptions(func: ICultureGet, options?: string[], isJoined?: boolean): IdLabelDto[];
|
|
50
69
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BusinessUtils = void 0;
|
|
4
4
|
const shared_1 = require("@etsoo/shared");
|
|
5
|
+
const __1 = require("..");
|
|
5
6
|
const EntityStatus_1 = require("./EntityStatus");
|
|
6
7
|
const ProductUnit_1 = require("./ProductUnit");
|
|
7
8
|
/**
|
|
@@ -25,7 +26,7 @@ var BusinessUtils;
|
|
|
25
26
|
BusinessUtils.addIdLabelBlankItem = addIdLabelBlankItem;
|
|
26
27
|
/**
|
|
27
28
|
* Get product unit's label
|
|
28
|
-
* Please define the label in culture with key '
|
|
29
|
+
* Please define the label in culture with key 'statusNormal' for Normal status
|
|
29
30
|
* @param unit Unit
|
|
30
31
|
* @param func Label delegate
|
|
31
32
|
* @returns Label
|
|
@@ -58,27 +59,52 @@ var BusinessUtils;
|
|
|
58
59
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
59
60
|
* @param unit Unit
|
|
60
61
|
* @param func Label delegate
|
|
62
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
61
63
|
* @returns Label
|
|
62
64
|
*/
|
|
63
|
-
function getUnitLabel(unit, func) {
|
|
65
|
+
function getUnitLabel(unit, func, isJoined) {
|
|
64
66
|
var _a;
|
|
65
67
|
const key = ProductUnit_1.ProductUnit[unit];
|
|
66
|
-
|
|
68
|
+
const label = (_a = func('unit' + key)) !== null && _a !== void 0 ? _a : key;
|
|
69
|
+
if (isJoined) {
|
|
70
|
+
const jLabel = func('unitJoin');
|
|
71
|
+
if (jLabel)
|
|
72
|
+
return jLabel.format(label);
|
|
73
|
+
}
|
|
74
|
+
return label;
|
|
67
75
|
}
|
|
68
76
|
BusinessUtils.getUnitLabel = getUnitLabel;
|
|
69
77
|
/**
|
|
78
|
+
*
|
|
70
79
|
* Get all product units
|
|
71
80
|
* @param func Label delegate
|
|
81
|
+
* @param options Define the order and limit the items
|
|
82
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
72
83
|
* @returns Units
|
|
73
84
|
*/
|
|
74
|
-
function getUnits(func) {
|
|
75
|
-
|
|
85
|
+
function getUnits(func, options, isJoined) {
|
|
86
|
+
options !== null && options !== void 0 ? options : (options = shared_1.DataTypes.getEnumKeys(ProductUnit_1.ProductUnit));
|
|
87
|
+
return options.map((key) => {
|
|
76
88
|
const id = shared_1.DataTypes.getEnumByKey(ProductUnit_1.ProductUnit, key);
|
|
77
89
|
return {
|
|
78
90
|
id,
|
|
79
|
-
label: getUnitLabel(id, func)
|
|
91
|
+
label: getUnitLabel(id, func, isJoined).formatInitial(true)
|
|
80
92
|
};
|
|
81
93
|
});
|
|
82
94
|
}
|
|
83
95
|
BusinessUtils.getUnits = getUnits;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* Get all repeat options
|
|
99
|
+
* @param func Label delegate
|
|
100
|
+
* @param options Define the order and limit the items
|
|
101
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
102
|
+
* @returns Units
|
|
103
|
+
*/
|
|
104
|
+
function getRepeatOptions(func, options, isJoined = true) {
|
|
105
|
+
options !== null && options !== void 0 ? options : (options = shared_1.DataTypes.getEnumKeys(__1.RepeatOption));
|
|
106
|
+
isJoined !== null && isJoined !== void 0 ? isJoined : (isJoined = true);
|
|
107
|
+
return getUnits(func, options, isJoined);
|
|
108
|
+
}
|
|
109
|
+
BusinessUtils.getRepeatOptions = getRepeatOptions;
|
|
84
110
|
})(BusinessUtils = exports.BusinessUtils || (exports.BusinessUtils = {}));
|
|
@@ -1,66 +1,68 @@
|
|
|
1
|
+
import { RepeatOption } from './RepeatOption';
|
|
1
2
|
/**
|
|
2
|
-
* Product units
|
|
3
|
-
*
|
|
3
|
+
* Product base units
|
|
4
|
+
* 1 - 9
|
|
4
5
|
*/
|
|
5
|
-
export declare enum
|
|
6
|
+
export declare enum ProductBaseUnit {
|
|
6
7
|
/**
|
|
7
8
|
* Picese
|
|
8
9
|
* 件
|
|
9
10
|
*/
|
|
10
|
-
PC =
|
|
11
|
+
PC = 1,
|
|
11
12
|
/**
|
|
12
13
|
* Set
|
|
13
14
|
* 套
|
|
14
15
|
*/
|
|
15
|
-
SET =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* Quater
|
|
23
|
-
* 季
|
|
24
|
-
*/
|
|
25
|
-
QUATER = 11,
|
|
26
|
-
/**
|
|
27
|
-
* Month
|
|
28
|
-
* 月
|
|
29
|
-
*/
|
|
30
|
-
MONTH = 12,
|
|
31
|
-
/**
|
|
32
|
-
* Fortnight
|
|
33
|
-
* 两周
|
|
34
|
-
*/
|
|
35
|
-
FORNIGHT = 13,
|
|
36
|
-
/**
|
|
37
|
-
* Week
|
|
38
|
-
* 周
|
|
39
|
-
*/
|
|
40
|
-
WEEK = 14,
|
|
41
|
-
/**
|
|
42
|
-
* Day
|
|
43
|
-
* 天
|
|
44
|
-
*/
|
|
45
|
-
DAY = 15,
|
|
16
|
+
SET = 2
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Product weight units
|
|
20
|
+
* Range 40 - 49
|
|
21
|
+
*/
|
|
22
|
+
export declare enum ProductWeightUnit {
|
|
46
23
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
24
|
+
* Gram
|
|
25
|
+
* 克
|
|
49
26
|
*/
|
|
50
|
-
|
|
27
|
+
GRAM = 40,
|
|
51
28
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
29
|
+
* Half Kg
|
|
30
|
+
* 斤
|
|
54
31
|
*/
|
|
55
|
-
|
|
32
|
+
JIN = 41,
|
|
56
33
|
/**
|
|
57
34
|
* Kilogram
|
|
58
35
|
* 千克
|
|
59
36
|
*/
|
|
60
|
-
KILOGRAM =
|
|
37
|
+
KILOGRAM = 42,
|
|
61
38
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
39
|
+
* Ton
|
|
40
|
+
* 吨
|
|
64
41
|
*/
|
|
65
|
-
|
|
42
|
+
TON = 49
|
|
66
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Product units enum
|
|
46
|
+
* Repeat options take range 10 - 39
|
|
47
|
+
* See com.etsoo.CoreFramework.Business.ProductUnit
|
|
48
|
+
*/
|
|
49
|
+
export declare const ProductUnit: {
|
|
50
|
+
[x: number]: string;
|
|
51
|
+
GRAM: ProductWeightUnit.GRAM;
|
|
52
|
+
JIN: ProductWeightUnit.JIN;
|
|
53
|
+
KILOGRAM: ProductWeightUnit.KILOGRAM;
|
|
54
|
+
TON: ProductWeightUnit.TON;
|
|
55
|
+
HOUR: RepeatOption.HOUR;
|
|
56
|
+
DAY: RepeatOption.DAY;
|
|
57
|
+
YEAR: RepeatOption.YEAR;
|
|
58
|
+
WEEK: RepeatOption.WEEK;
|
|
59
|
+
FORTNIGHT: RepeatOption.FORTNIGHT;
|
|
60
|
+
FOURWEEK: RepeatOption.FOURWEEK;
|
|
61
|
+
MONTH: RepeatOption.MONTH;
|
|
62
|
+
BIMONTH: RepeatOption.BIMONTH;
|
|
63
|
+
QUATER: RepeatOption.QUATER;
|
|
64
|
+
HALFYEAR: RepeatOption.HALFYEAR;
|
|
65
|
+
PC: ProductBaseUnit.PC;
|
|
66
|
+
SET: ProductBaseUnit.SET;
|
|
67
|
+
};
|
|
68
|
+
export declare type ProductUnit = ProductBaseUnit | RepeatOption | ProductWeightUnit;
|
|
@@ -1,70 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductUnit = void 0;
|
|
3
|
+
exports.ProductUnit = exports.ProductWeightUnit = exports.ProductBaseUnit = void 0;
|
|
4
|
+
const RepeatOption_1 = require("./RepeatOption");
|
|
4
5
|
/**
|
|
5
|
-
* Product units
|
|
6
|
-
*
|
|
6
|
+
* Product base units
|
|
7
|
+
* 1 - 9
|
|
7
8
|
*/
|
|
8
|
-
var
|
|
9
|
-
(function (
|
|
9
|
+
var ProductBaseUnit;
|
|
10
|
+
(function (ProductBaseUnit) {
|
|
10
11
|
/**
|
|
11
12
|
* Picese
|
|
12
13
|
* 件
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
+
ProductBaseUnit[ProductBaseUnit["PC"] = 1] = "PC";
|
|
15
16
|
/**
|
|
16
17
|
* Set
|
|
17
18
|
* 套
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* 季
|
|
28
|
-
*/
|
|
29
|
-
ProductUnit[ProductUnit["QUATER"] = 11] = "QUATER";
|
|
30
|
-
/**
|
|
31
|
-
* Month
|
|
32
|
-
* 月
|
|
33
|
-
*/
|
|
34
|
-
ProductUnit[ProductUnit["MONTH"] = 12] = "MONTH";
|
|
35
|
-
/**
|
|
36
|
-
* Fortnight
|
|
37
|
-
* 两周
|
|
38
|
-
*/
|
|
39
|
-
ProductUnit[ProductUnit["FORNIGHT"] = 13] = "FORNIGHT";
|
|
40
|
-
/**
|
|
41
|
-
* Week
|
|
42
|
-
* 周
|
|
43
|
-
*/
|
|
44
|
-
ProductUnit[ProductUnit["WEEK"] = 14] = "WEEK";
|
|
45
|
-
/**
|
|
46
|
-
* Day
|
|
47
|
-
* 天
|
|
48
|
-
*/
|
|
49
|
-
ProductUnit[ProductUnit["DAY"] = 15] = "DAY";
|
|
20
|
+
ProductBaseUnit[ProductBaseUnit["SET"] = 2] = "SET";
|
|
21
|
+
})(ProductBaseUnit = exports.ProductBaseUnit || (exports.ProductBaseUnit = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Product weight units
|
|
24
|
+
* Range 40 - 49
|
|
25
|
+
*/
|
|
26
|
+
var ProductWeightUnit;
|
|
27
|
+
(function (ProductWeightUnit) {
|
|
50
28
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
29
|
+
* Gram
|
|
30
|
+
* 克
|
|
53
31
|
*/
|
|
54
|
-
|
|
32
|
+
ProductWeightUnit[ProductWeightUnit["GRAM"] = 40] = "GRAM";
|
|
55
33
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
34
|
+
* Half Kg
|
|
35
|
+
* 斤
|
|
58
36
|
*/
|
|
59
|
-
|
|
37
|
+
ProductWeightUnit[ProductWeightUnit["JIN"] = 41] = "JIN";
|
|
60
38
|
/**
|
|
61
39
|
* Kilogram
|
|
62
40
|
* 千克
|
|
63
41
|
*/
|
|
64
|
-
|
|
42
|
+
ProductWeightUnit[ProductWeightUnit["KILOGRAM"] = 42] = "KILOGRAM";
|
|
65
43
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
44
|
+
* Ton
|
|
45
|
+
* 吨
|
|
68
46
|
*/
|
|
69
|
-
|
|
70
|
-
})(
|
|
47
|
+
ProductWeightUnit[ProductWeightUnit["TON"] = 49] = "TON";
|
|
48
|
+
})(ProductWeightUnit = exports.ProductWeightUnit || (exports.ProductWeightUnit = {}));
|
|
49
|
+
/**
|
|
50
|
+
* Product units enum
|
|
51
|
+
* Repeat options take range 10 - 39
|
|
52
|
+
* See com.etsoo.CoreFramework.Business.ProductUnit
|
|
53
|
+
*/
|
|
54
|
+
exports.ProductUnit = {
|
|
55
|
+
...ProductBaseUnit,
|
|
56
|
+
...RepeatOption_1.RepeatOption,
|
|
57
|
+
...ProductWeightUnit
|
|
58
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeat options
|
|
3
|
+
* Part of ProductUnit, range 10 - 39
|
|
4
|
+
*/
|
|
5
|
+
export declare enum RepeatOption {
|
|
6
|
+
/**
|
|
7
|
+
* Hour
|
|
8
|
+
* 小时
|
|
9
|
+
*/
|
|
10
|
+
HOUR = 10,
|
|
11
|
+
/**
|
|
12
|
+
* Day
|
|
13
|
+
* 天
|
|
14
|
+
*/
|
|
15
|
+
DAY = 11,
|
|
16
|
+
/**
|
|
17
|
+
* Year
|
|
18
|
+
* 年
|
|
19
|
+
*/
|
|
20
|
+
YEAR = 12,
|
|
21
|
+
/**
|
|
22
|
+
* Week
|
|
23
|
+
* 周
|
|
24
|
+
*/
|
|
25
|
+
WEEK = 21,
|
|
26
|
+
/**
|
|
27
|
+
* Two weeks
|
|
28
|
+
* 两周
|
|
29
|
+
*/
|
|
30
|
+
FORTNIGHT = 22,
|
|
31
|
+
/**
|
|
32
|
+
* Four weeks
|
|
33
|
+
* 四周
|
|
34
|
+
*/
|
|
35
|
+
FOURWEEK = 24,
|
|
36
|
+
/**
|
|
37
|
+
* Month
|
|
38
|
+
* 月
|
|
39
|
+
*/
|
|
40
|
+
MONTH = 31,
|
|
41
|
+
/**
|
|
42
|
+
* Two months
|
|
43
|
+
* 两月
|
|
44
|
+
*/
|
|
45
|
+
BIMONTH = 32,
|
|
46
|
+
/**
|
|
47
|
+
* Quater(3 months)
|
|
48
|
+
* 季(三个月)
|
|
49
|
+
*/
|
|
50
|
+
QUATER = 33,
|
|
51
|
+
/**
|
|
52
|
+
* Half a year
|
|
53
|
+
* 半年
|
|
54
|
+
*/
|
|
55
|
+
HALFYEAR = 36
|
|
56
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RepeatOption = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Repeat options
|
|
6
|
+
* Part of ProductUnit, range 10 - 39
|
|
7
|
+
*/
|
|
8
|
+
var RepeatOption;
|
|
9
|
+
(function (RepeatOption) {
|
|
10
|
+
/**
|
|
11
|
+
* Hour
|
|
12
|
+
* 小时
|
|
13
|
+
*/
|
|
14
|
+
RepeatOption[RepeatOption["HOUR"] = 10] = "HOUR";
|
|
15
|
+
/**
|
|
16
|
+
* Day
|
|
17
|
+
* 天
|
|
18
|
+
*/
|
|
19
|
+
RepeatOption[RepeatOption["DAY"] = 11] = "DAY";
|
|
20
|
+
/**
|
|
21
|
+
* Year
|
|
22
|
+
* 年
|
|
23
|
+
*/
|
|
24
|
+
RepeatOption[RepeatOption["YEAR"] = 12] = "YEAR";
|
|
25
|
+
/**
|
|
26
|
+
* Week
|
|
27
|
+
* 周
|
|
28
|
+
*/
|
|
29
|
+
RepeatOption[RepeatOption["WEEK"] = 21] = "WEEK";
|
|
30
|
+
/**
|
|
31
|
+
* Two weeks
|
|
32
|
+
* 两周
|
|
33
|
+
*/
|
|
34
|
+
RepeatOption[RepeatOption["FORTNIGHT"] = 22] = "FORTNIGHT";
|
|
35
|
+
/**
|
|
36
|
+
* Four weeks
|
|
37
|
+
* 四周
|
|
38
|
+
*/
|
|
39
|
+
RepeatOption[RepeatOption["FOURWEEK"] = 24] = "FOURWEEK";
|
|
40
|
+
/**
|
|
41
|
+
* Month
|
|
42
|
+
* 月
|
|
43
|
+
*/
|
|
44
|
+
RepeatOption[RepeatOption["MONTH"] = 31] = "MONTH";
|
|
45
|
+
/**
|
|
46
|
+
* Two months
|
|
47
|
+
* 两月
|
|
48
|
+
*/
|
|
49
|
+
RepeatOption[RepeatOption["BIMONTH"] = 32] = "BIMONTH";
|
|
50
|
+
/**
|
|
51
|
+
* Quater(3 months)
|
|
52
|
+
* 季(三个月)
|
|
53
|
+
*/
|
|
54
|
+
RepeatOption[RepeatOption["QUATER"] = 33] = "QUATER";
|
|
55
|
+
/**
|
|
56
|
+
* Half a year
|
|
57
|
+
* 半年
|
|
58
|
+
*/
|
|
59
|
+
RepeatOption[RepeatOption["HALFYEAR"] = 36] = "HALFYEAR";
|
|
60
|
+
})(RepeatOption = exports.RepeatOption || (exports.RepeatOption = {}));
|
package/lib/cjs/i18n/en-US.json
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"pageNotFound": "Page Not Found",
|
|
45
45
|
"prompt": "Input",
|
|
46
46
|
"pullToRefresh": "Pull down to refresh",
|
|
47
|
+
"record": "Record",
|
|
47
48
|
"refresh": "Refresh",
|
|
48
49
|
"refreshing": "Refreshing",
|
|
49
50
|
"releaseToRefresh": "Release to refresh",
|
|
@@ -77,6 +78,22 @@
|
|
|
77
78
|
"tokenExpiry": "Your session is about to expire. Click the Cancel button to continue",
|
|
78
79
|
"yes": "Yes",
|
|
79
80
|
"unknownError": "Unknown Error",
|
|
81
|
+
"unitJoin": "per {0}",
|
|
82
|
+
"unitPC": "PC",
|
|
83
|
+
"unitSET": "SET",
|
|
84
|
+
"unitHOUR": "Hour",
|
|
85
|
+
"unitDAY": "Day",
|
|
86
|
+
"unitYEAR": "Year",
|
|
87
|
+
"unitWEEK": "Week",
|
|
88
|
+
"unitFORTNIGHT": "Fortnight",
|
|
89
|
+
"unitFOURWEEK": "4-week",
|
|
90
|
+
"unitMONTH": "Month",
|
|
91
|
+
"unitBIMONTH": "2-month",
|
|
92
|
+
"unitQUATER": "Quater",
|
|
93
|
+
"unitHALFYEAR": "6-month",
|
|
94
|
+
"unitGRAM": "g",
|
|
95
|
+
"unitJIN": "½Kg",
|
|
96
|
+
"unitKILOGRAM": "Kg",
|
|
80
97
|
"warning": "Warning",
|
|
81
98
|
"welcome": "{0}, welcome!"
|
|
82
99
|
}
|
package/lib/cjs/i18n/zh-CN.json
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"pageNotFound": "找不到页面",
|
|
45
45
|
"prompt": "输入",
|
|
46
46
|
"pullToRefresh": "下拉刷新",
|
|
47
|
+
"record": "记录",
|
|
47
48
|
"refresh": "刷新",
|
|
48
49
|
"refreshing": "正在刷新",
|
|
49
50
|
"releaseToRefresh": "释放刷新",
|
|
@@ -77,6 +78,23 @@
|
|
|
77
78
|
"tokenExpiry": "您的会话即将过期。点击 取消 按钮继续使用",
|
|
78
79
|
"yes": "是",
|
|
79
80
|
"unknownError": "未知错误",
|
|
81
|
+
"unitJoin": "每{0}",
|
|
82
|
+
"unitPC": "件",
|
|
83
|
+
"unitSET": "套",
|
|
84
|
+
"unitHOUR": "小时",
|
|
85
|
+
"unitDAY": "天",
|
|
86
|
+
"unitYEAR": "年",
|
|
87
|
+
"unitWEEK": "周",
|
|
88
|
+
"unitFORTNIGHT": "两周",
|
|
89
|
+
"unitFOURWEEK": "四周",
|
|
90
|
+
"unitMONTH": "月",
|
|
91
|
+
"unitBIMONTH": "两月",
|
|
92
|
+
"unitQUATER": "季度",
|
|
93
|
+
"unitHALFYEAR": "半年",
|
|
94
|
+
"unitGRAM": "克",
|
|
95
|
+
"unitJIN": "斤",
|
|
96
|
+
"unitKILOGRAM": "公斤",
|
|
97
|
+
"unitTON": "吨",
|
|
80
98
|
"warning": "警告",
|
|
81
99
|
"welcome": "{0}, 欢迎光临!"
|
|
82
100
|
}
|
package/lib/cjs/i18n/zh-HK.json
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"pageNotFound": "找不到頁面",
|
|
45
45
|
"prompt": "輸入",
|
|
46
46
|
"pullToRefresh": "下拉刷新",
|
|
47
|
+
"record": "記錄",
|
|
47
48
|
"refresh": "刷新",
|
|
48
49
|
"refreshing": "正在刷新",
|
|
49
50
|
"releaseToRefresh": "釋放刷新",
|
|
@@ -77,6 +78,22 @@
|
|
|
77
78
|
"tokenExpiry": "您的會話即將過期。點擊 取消 按鈕繼續使用",
|
|
78
79
|
"yes": "是",
|
|
79
80
|
"unknownError": "未知錯誤",
|
|
81
|
+
"unitJoin": "每{0}",
|
|
82
|
+
"unitPC": "件",
|
|
83
|
+
"unitSET": "套",
|
|
84
|
+
"unitHOUR": "小時",
|
|
85
|
+
"unitDAY": "天",
|
|
86
|
+
"unitYEAR": "年",
|
|
87
|
+
"unitWEEK": "週",
|
|
88
|
+
"unitFORTNIGHT": "兩週",
|
|
89
|
+
"unitFOURWEEK": "四周",
|
|
90
|
+
"unitMONTH": "月",
|
|
91
|
+
"unitBIMONTH": "兩月",
|
|
92
|
+
"unitQUATER": "季度",
|
|
93
|
+
"unitHALFYEAR": "半年",
|
|
94
|
+
"unitGRAM": "克",
|
|
95
|
+
"unitJIN": "斤",
|
|
96
|
+
"unitKILOGRAM": "公斤",
|
|
80
97
|
"warning": "警告",
|
|
81
98
|
"welcome": "{0}, 歡迎光臨!"
|
|
82
99
|
}
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './business/BusinessTax';
|
|
|
12
12
|
export * from './business/BusinessUtils';
|
|
13
13
|
export * from './business/EntityStatus';
|
|
14
14
|
export * from './business/ProductUnit';
|
|
15
|
+
export * from './business/RepeatOption';
|
|
15
16
|
export * from './def/ListItem';
|
|
16
17
|
export * from './dto/IdDto';
|
|
17
18
|
export * from './dto/IdLabelDto';
|
package/lib/cjs/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./business/BusinessTax"), exports);
|
|
|
29
29
|
__exportStar(require("./business/BusinessUtils"), exports);
|
|
30
30
|
__exportStar(require("./business/EntityStatus"), exports);
|
|
31
31
|
__exportStar(require("./business/ProductUnit"), exports);
|
|
32
|
+
__exportStar(require("./business/RepeatOption"), exports);
|
|
32
33
|
// def
|
|
33
34
|
__exportStar(require("./def/ListItem"), exports);
|
|
34
35
|
// dto
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { INotifier, NotificationAlign, NotificationCallProps, NotificationConten
|
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
3
|
import { DataTypes, DateUtils, IStorage } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
|
+
import { ProductUnit } from '../business/ProductUnit';
|
|
5
6
|
import { IdLabelDto } from '../dto/IdLabelDto';
|
|
6
7
|
import { InitCallDto } from '../dto/InitCallDto';
|
|
7
8
|
import { IActionResult } from '../result/IActionResult';
|
|
@@ -255,6 +256,12 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
|
|
|
255
256
|
* @returns Time zone
|
|
256
257
|
*/
|
|
257
258
|
getTimeZone(): string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* Get product unit and repeat option label
|
|
261
|
+
* @param unit Product unit or repeat option
|
|
262
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
263
|
+
*/
|
|
264
|
+
getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string;
|
|
258
265
|
/**
|
|
259
266
|
* Hash message, SHA3 or HmacSHA512, 512 as Base64
|
|
260
267
|
* https://cryptojs.gitbook.io/docs/
|
|
@@ -646,6 +653,12 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
646
653
|
* @returns Time zone
|
|
647
654
|
*/
|
|
648
655
|
getTimeZone(): string | undefined;
|
|
656
|
+
/**
|
|
657
|
+
* Get product unit and repeat option label
|
|
658
|
+
* @param unit Product unit or repeat option
|
|
659
|
+
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
660
|
+
*/
|
|
661
|
+
getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string;
|
|
649
662
|
/**
|
|
650
663
|
* Hash message, SHA3 or HmacSHA512, 512 as Base64
|
|
651
664
|
* https://cryptojs.gitbook.io/docs/
|