@etsoo/appscript 1.2.28 → 1.2.29
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/README.md
CHANGED
|
@@ -64,9 +64,12 @@ $ yarn add @etsoo/appscript
|
|
|
64
64
|
- BusinessTax - Business tax
|
|
65
65
|
|
|
66
66
|
#### BusinessUtils.ts ####
|
|
67
|
-
-
|
|
67
|
+
- getCurrencies - Get currency collection
|
|
68
|
+
- getEntityStatusLabel - Get entity status's label
|
|
69
|
+
- getEntityStatus - Get entity status collection
|
|
68
70
|
- getUnitLabel - Get product unit's label
|
|
69
71
|
- getUnits - Get all product units
|
|
72
|
+
- getRepeatOptions - Get all repeat options
|
|
70
73
|
|
|
71
74
|
#### ProductUnit.ts ####
|
|
72
75
|
- ProductUnit - Product units enum
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DataTypes } from '@etsoo/shared';
|
|
2
1
|
import { IdLabelDto } from '../dto/IdLabelDto';
|
|
3
2
|
import { ICultureGet } from '../state/Culture';
|
|
4
3
|
import { EntityStatus } from './EntityStatus';
|
|
@@ -7,13 +6,6 @@ import { ProductUnit } from './ProductUnit';
|
|
|
7
6
|
* Business utils
|
|
8
7
|
*/
|
|
9
8
|
export declare namespace BusinessUtils {
|
|
10
|
-
/**
|
|
11
|
-
* Add blank item to id/label data array
|
|
12
|
-
* @param input Input array
|
|
13
|
-
* @param copy Copy or change the current inpu
|
|
14
|
-
* @returns Items with blank item
|
|
15
|
-
*/
|
|
16
|
-
function addIdLabelBlankItem<T extends DataTypes.IdType = number>(input: IdLabelDto<T>[], copy?: boolean): IdLabelDto<T>[];
|
|
17
9
|
/**
|
|
18
10
|
* Get currency collection
|
|
19
11
|
* @param currencyNames Names like CNY, USD
|
|
@@ -22,16 +14,15 @@ export declare namespace BusinessUtils {
|
|
|
22
14
|
*/
|
|
23
15
|
function getCurrencies(currencyNames: string[], func: ICultureGet): IdLabelDto<string>[];
|
|
24
16
|
/**
|
|
25
|
-
* Get
|
|
26
|
-
* Please define the label
|
|
17
|
+
* Get entity status's label
|
|
18
|
+
* Please define the label with key 'statusNormal' for Normal status
|
|
27
19
|
* @param unit Unit
|
|
28
20
|
* @param func Label delegate
|
|
29
21
|
* @returns Label
|
|
30
22
|
*/
|
|
31
23
|
function getEntityStatusLabel(status: EntityStatus, func: ICultureGet): string;
|
|
32
24
|
/**
|
|
33
|
-
* Get
|
|
34
|
-
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
25
|
+
* Get entity status collection
|
|
35
26
|
* @param unit Unit
|
|
36
27
|
* @param func Label delegate
|
|
37
28
|
* @returns Label
|
|
@@ -10,20 +10,6 @@ const ProductUnit_1 = require("./ProductUnit");
|
|
|
10
10
|
*/
|
|
11
11
|
var BusinessUtils;
|
|
12
12
|
(function (BusinessUtils) {
|
|
13
|
-
/**
|
|
14
|
-
* Add blank item to id/label data array
|
|
15
|
-
* @param input Input array
|
|
16
|
-
* @param copy Copy or change the current inpu
|
|
17
|
-
* @returns Items with blank item
|
|
18
|
-
*/
|
|
19
|
-
function addIdLabelBlankItem(input, copy = false) {
|
|
20
|
-
const blankItem = { id: '', label: '---' };
|
|
21
|
-
if (copy)
|
|
22
|
-
return [blankItem, ...input];
|
|
23
|
-
input.unshift(blankItem);
|
|
24
|
-
return input;
|
|
25
|
-
}
|
|
26
|
-
BusinessUtils.addIdLabelBlankItem = addIdLabelBlankItem;
|
|
27
13
|
/**
|
|
28
14
|
* Get currency collection
|
|
29
15
|
* @param currencyNames Names like CNY, USD
|
|
@@ -41,8 +27,8 @@ var BusinessUtils;
|
|
|
41
27
|
}
|
|
42
28
|
BusinessUtils.getCurrencies = getCurrencies;
|
|
43
29
|
/**
|
|
44
|
-
* Get
|
|
45
|
-
* Please define the label
|
|
30
|
+
* Get entity status's label
|
|
31
|
+
* Please define the label with key 'statusNormal' for Normal status
|
|
46
32
|
* @param unit Unit
|
|
47
33
|
* @param func Label delegate
|
|
48
34
|
* @returns Label
|
|
@@ -54,8 +40,7 @@ var BusinessUtils;
|
|
|
54
40
|
}
|
|
55
41
|
BusinessUtils.getEntityStatusLabel = getEntityStatusLabel;
|
|
56
42
|
/**
|
|
57
|
-
* Get
|
|
58
|
-
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
43
|
+
* Get entity status collection
|
|
59
44
|
* @param unit Unit
|
|
60
45
|
* @param func Label delegate
|
|
61
46
|
* @returns Label
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DataTypes } from '@etsoo/shared';
|
|
2
1
|
import { IdLabelDto } from '../dto/IdLabelDto';
|
|
3
2
|
import { ICultureGet } from '../state/Culture';
|
|
4
3
|
import { EntityStatus } from './EntityStatus';
|
|
@@ -7,13 +6,6 @@ import { ProductUnit } from './ProductUnit';
|
|
|
7
6
|
* Business utils
|
|
8
7
|
*/
|
|
9
8
|
export declare namespace BusinessUtils {
|
|
10
|
-
/**
|
|
11
|
-
* Add blank item to id/label data array
|
|
12
|
-
* @param input Input array
|
|
13
|
-
* @param copy Copy or change the current inpu
|
|
14
|
-
* @returns Items with blank item
|
|
15
|
-
*/
|
|
16
|
-
function addIdLabelBlankItem<T extends DataTypes.IdType = number>(input: IdLabelDto<T>[], copy?: boolean): IdLabelDto<T>[];
|
|
17
9
|
/**
|
|
18
10
|
* Get currency collection
|
|
19
11
|
* @param currencyNames Names like CNY, USD
|
|
@@ -22,16 +14,15 @@ export declare namespace BusinessUtils {
|
|
|
22
14
|
*/
|
|
23
15
|
function getCurrencies(currencyNames: string[], func: ICultureGet): IdLabelDto<string>[];
|
|
24
16
|
/**
|
|
25
|
-
* Get
|
|
26
|
-
* Please define the label
|
|
17
|
+
* Get entity status's label
|
|
18
|
+
* Please define the label with key 'statusNormal' for Normal status
|
|
27
19
|
* @param unit Unit
|
|
28
20
|
* @param func Label delegate
|
|
29
21
|
* @returns Label
|
|
30
22
|
*/
|
|
31
23
|
function getEntityStatusLabel(status: EntityStatus, func: ICultureGet): string;
|
|
32
24
|
/**
|
|
33
|
-
* Get
|
|
34
|
-
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
25
|
+
* Get entity status collection
|
|
35
26
|
* @param unit Unit
|
|
36
27
|
* @param func Label delegate
|
|
37
28
|
* @returns Label
|
|
@@ -7,20 +7,6 @@ import { ProductUnit } from './ProductUnit';
|
|
|
7
7
|
*/
|
|
8
8
|
export var BusinessUtils;
|
|
9
9
|
(function (BusinessUtils) {
|
|
10
|
-
/**
|
|
11
|
-
* Add blank item to id/label data array
|
|
12
|
-
* @param input Input array
|
|
13
|
-
* @param copy Copy or change the current inpu
|
|
14
|
-
* @returns Items with blank item
|
|
15
|
-
*/
|
|
16
|
-
function addIdLabelBlankItem(input, copy = false) {
|
|
17
|
-
const blankItem = { id: '', label: '---' };
|
|
18
|
-
if (copy)
|
|
19
|
-
return [blankItem, ...input];
|
|
20
|
-
input.unshift(blankItem);
|
|
21
|
-
return input;
|
|
22
|
-
}
|
|
23
|
-
BusinessUtils.addIdLabelBlankItem = addIdLabelBlankItem;
|
|
24
10
|
/**
|
|
25
11
|
* Get currency collection
|
|
26
12
|
* @param currencyNames Names like CNY, USD
|
|
@@ -38,8 +24,8 @@ export var BusinessUtils;
|
|
|
38
24
|
}
|
|
39
25
|
BusinessUtils.getCurrencies = getCurrencies;
|
|
40
26
|
/**
|
|
41
|
-
* Get
|
|
42
|
-
* Please define the label
|
|
27
|
+
* Get entity status's label
|
|
28
|
+
* Please define the label with key 'statusNormal' for Normal status
|
|
43
29
|
* @param unit Unit
|
|
44
30
|
* @param func Label delegate
|
|
45
31
|
* @returns Label
|
|
@@ -51,8 +37,7 @@ export var BusinessUtils;
|
|
|
51
37
|
}
|
|
52
38
|
BusinessUtils.getEntityStatusLabel = getEntityStatusLabel;
|
|
53
39
|
/**
|
|
54
|
-
* Get
|
|
55
|
-
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
40
|
+
* Get entity status collection
|
|
56
41
|
* @param unit Unit
|
|
57
42
|
* @param func Label delegate
|
|
58
43
|
* @returns Label
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.29",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@etsoo/notificationbase": "^1.1.0",
|
|
56
56
|
"@etsoo/restclient": "^1.0.64",
|
|
57
|
-
"@etsoo/shared": "^1.1.
|
|
57
|
+
"@etsoo/shared": "^1.1.9",
|
|
58
58
|
"@types/crypto-js": "^4.1.0",
|
|
59
59
|
"crypto-js": "^4.1.1"
|
|
60
60
|
},
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@types/jest": "^27.4.0",
|
|
68
68
|
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
69
69
|
"@typescript-eslint/parser": "^5.10.1",
|
|
70
|
-
"eslint": "^8.
|
|
70
|
+
"eslint": "^8.8.0",
|
|
71
71
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
72
72
|
"eslint-plugin-import": "^2.25.4",
|
|
73
73
|
"jest": "^27.4.7",
|
|
@@ -9,23 +9,6 @@ import { ProductUnit } from './ProductUnit';
|
|
|
9
9
|
* Business utils
|
|
10
10
|
*/
|
|
11
11
|
export namespace BusinessUtils {
|
|
12
|
-
/**
|
|
13
|
-
* Add blank item to id/label data array
|
|
14
|
-
* @param input Input array
|
|
15
|
-
* @param copy Copy or change the current inpu
|
|
16
|
-
* @returns Items with blank item
|
|
17
|
-
*/
|
|
18
|
-
export function addIdLabelBlankItem<T extends DataTypes.IdType = number>(
|
|
19
|
-
input: IdLabelDto<T>[],
|
|
20
|
-
copy: boolean = false
|
|
21
|
-
) {
|
|
22
|
-
const blankItem: IdLabelDto<T> = { id: '' as any, label: '---' };
|
|
23
|
-
if (copy) return [blankItem, ...input];
|
|
24
|
-
|
|
25
|
-
input.unshift(blankItem);
|
|
26
|
-
return input;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
12
|
/**
|
|
30
13
|
* Get currency collection
|
|
31
14
|
* @param currencyNames Names like CNY, USD
|
|
@@ -43,8 +26,8 @@ export namespace BusinessUtils {
|
|
|
43
26
|
}
|
|
44
27
|
|
|
45
28
|
/**
|
|
46
|
-
* Get
|
|
47
|
-
* Please define the label
|
|
29
|
+
* Get entity status's label
|
|
30
|
+
* Please define the label with key 'statusNormal' for Normal status
|
|
48
31
|
* @param unit Unit
|
|
49
32
|
* @param func Label delegate
|
|
50
33
|
* @returns Label
|
|
@@ -58,8 +41,7 @@ export namespace BusinessUtils {
|
|
|
58
41
|
}
|
|
59
42
|
|
|
60
43
|
/**
|
|
61
|
-
* Get
|
|
62
|
-
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
44
|
+
* Get entity status collection
|
|
63
45
|
* @param unit Unit
|
|
64
46
|
* @param func Label delegate
|
|
65
47
|
* @returns Label
|