@etsoo/appscript 1.2.48 → 1.2.49
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/app/CoreApp.d.ts +2 -1
- package/lib/cjs/app/CoreApp.js +2 -1
- package/lib/cjs/business/BusinessUtils.d.ts +8 -0
- package/lib/cjs/business/BusinessUtils.js +17 -0
- package/lib/cjs/i18n/en-US.json +15 -0
- package/lib/cjs/i18n/zh-CN.json +15 -0
- package/lib/cjs/i18n/zh-HK.json +15 -0
- package/lib/mjs/app/CoreApp.d.ts +2 -1
- package/lib/mjs/app/CoreApp.js +2 -1
- package/lib/mjs/business/BusinessUtils.d.ts +8 -0
- package/lib/mjs/business/BusinessUtils.js +17 -0
- package/lib/mjs/i18n/en-US.json +15 -0
- package/lib/mjs/i18n/zh-CN.json +15 -0
- package/lib/mjs/i18n/zh-HK.json +15 -0
- package/package.json +1 -1
- package/src/app/CoreApp.ts +2 -1
- package/src/business/BusinessUtils.ts +20 -0
- package/src/i18n/en-US.json +15 -0
- package/src/i18n/zh-CN.json +15 -0
- package/src/i18n/zh-HK.json +15 -0
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -771,8 +771,9 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
771
771
|
* Try login, returning false means is loading
|
|
772
772
|
* UI get involved while refreshToken not intended
|
|
773
773
|
* @param data Additional request data
|
|
774
|
+
* @param showLoading Show loading bar or not during call
|
|
774
775
|
*/
|
|
775
|
-
tryLogin<D extends {} = {}>(_data?: D): Promise<boolean>;
|
|
776
|
+
tryLogin<D extends {} = {}>(_data?: D, _showLoading?: boolean): Promise<boolean>;
|
|
776
777
|
/**
|
|
777
778
|
* User login
|
|
778
779
|
* @param user User data
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -956,8 +956,9 @@ class CoreApp {
|
|
|
956
956
|
* Try login, returning false means is loading
|
|
957
957
|
* UI get involved while refreshToken not intended
|
|
958
958
|
* @param data Additional request data
|
|
959
|
+
* @param showLoading Show loading bar or not during call
|
|
959
960
|
*/
|
|
960
|
-
async tryLogin(_data) {
|
|
961
|
+
async tryLogin(_data, _showLoading) {
|
|
961
962
|
if (this._isTryingLogin)
|
|
962
963
|
return false;
|
|
963
964
|
this._isTryingLogin = true;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { IdLabelDto } from '../dto/IdLabelDto';
|
|
2
3
|
import { ICultureGet } from '../state/Culture';
|
|
3
4
|
import { EntityStatus } from './EntityStatus';
|
|
@@ -31,6 +32,13 @@ export declare namespace BusinessUtils {
|
|
|
31
32
|
id: EntityStatus;
|
|
32
33
|
label: string;
|
|
33
34
|
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Get 12-month items
|
|
37
|
+
* @param monthLabels Month labels
|
|
38
|
+
* @param startMonth Start month, 0 as Jan.
|
|
39
|
+
* @returns 12 months
|
|
40
|
+
*/
|
|
41
|
+
function getMonths(monthLabels: string[], startMonth?: number): DataTypes.IdLabelItem[];
|
|
34
42
|
/**
|
|
35
43
|
* Get product unit's label
|
|
36
44
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -55,6 +55,23 @@ var BusinessUtils;
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
BusinessUtils.getEntityStatus = getEntityStatus;
|
|
58
|
+
/**
|
|
59
|
+
* Get 12-month items
|
|
60
|
+
* @param monthLabels Month labels
|
|
61
|
+
* @param startMonth Start month, 0 as Jan.
|
|
62
|
+
* @returns 12 months
|
|
63
|
+
*/
|
|
64
|
+
function getMonths(monthLabels, startMonth = 0) {
|
|
65
|
+
const months = [];
|
|
66
|
+
for (let i = 0; i < 12; i++) {
|
|
67
|
+
if (startMonth >= 12)
|
|
68
|
+
startMonth = 0;
|
|
69
|
+
months.push({ id: startMonth, label: monthLabels[startMonth] });
|
|
70
|
+
startMonth++;
|
|
71
|
+
}
|
|
72
|
+
return months;
|
|
73
|
+
}
|
|
74
|
+
BusinessUtils.getMonths = getMonths;
|
|
58
75
|
/**
|
|
59
76
|
* Get product unit's label
|
|
60
77
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
package/lib/cjs/i18n/en-US.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "Message",
|
|
51
51
|
"mobile": "Mobile number",
|
|
52
52
|
"mobilePhones": "Mobile numbers",
|
|
53
|
+
"months": [
|
|
54
|
+
"Jan.",
|
|
55
|
+
"Feb.",
|
|
56
|
+
"Mar.",
|
|
57
|
+
"Apr.",
|
|
58
|
+
"May.",
|
|
59
|
+
"Jun.",
|
|
60
|
+
"Jul.",
|
|
61
|
+
"Aug.",
|
|
62
|
+
"Sep.",
|
|
63
|
+
"Oct.",
|
|
64
|
+
"Nov.",
|
|
65
|
+
"Dec."
|
|
66
|
+
],
|
|
53
67
|
"more": "More",
|
|
54
68
|
"moreTag": "{0} more",
|
|
55
69
|
"name": "Name",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "Page Not Found",
|
|
68
82
|
"prompt": "Input",
|
|
69
83
|
"pullToRefresh": "Pull down to refresh",
|
|
84
|
+
"quarters": ["Q1", "Q2", "Q3", "Q4"],
|
|
70
85
|
"record": "Record",
|
|
71
86
|
"refresh": "Refresh",
|
|
72
87
|
"refreshing": "Refreshing",
|
package/lib/cjs/i18n/zh-CN.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "留言",
|
|
51
51
|
"mobile": "手机号码",
|
|
52
52
|
"mobilePhones": "手机号码",
|
|
53
|
+
"months": [
|
|
54
|
+
"1月",
|
|
55
|
+
"2月",
|
|
56
|
+
"3月",
|
|
57
|
+
"4月",
|
|
58
|
+
"5月",
|
|
59
|
+
"6月",
|
|
60
|
+
"7月",
|
|
61
|
+
"8月",
|
|
62
|
+
"9月",
|
|
63
|
+
"10月",
|
|
64
|
+
"11月",
|
|
65
|
+
"12月"
|
|
66
|
+
],
|
|
53
67
|
"more": "更多",
|
|
54
68
|
"moreTag": "({0}+)",
|
|
55
69
|
"name": "姓名",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "找不到页面",
|
|
68
82
|
"prompt": "输入",
|
|
69
83
|
"pullToRefresh": "下拉刷新",
|
|
84
|
+
"quarters": ["一季度", "二季度", "三季度", "四季度"],
|
|
70
85
|
"record": "记录",
|
|
71
86
|
"refresh": "刷新",
|
|
72
87
|
"refreshing": "正在刷新",
|
package/lib/cjs/i18n/zh-HK.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "留言",
|
|
51
51
|
"mobilePhone": "手機號碼",
|
|
52
52
|
"mobilePhones": "手機號碼",
|
|
53
|
+
"months": [
|
|
54
|
+
"1月",
|
|
55
|
+
"2月",
|
|
56
|
+
"3月",
|
|
57
|
+
"4月",
|
|
58
|
+
"5月",
|
|
59
|
+
"6月",
|
|
60
|
+
"7月",
|
|
61
|
+
"8月",
|
|
62
|
+
"9月",
|
|
63
|
+
"10月",
|
|
64
|
+
"11月",
|
|
65
|
+
"12月"
|
|
66
|
+
],
|
|
53
67
|
"more": "更多",
|
|
54
68
|
"moreTag": "({0}+)",
|
|
55
69
|
"name": "姓名",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "找不到頁面",
|
|
68
82
|
"prompt": "輸入",
|
|
69
83
|
"pullToRefresh": "下拉刷新",
|
|
84
|
+
"quarters": ["一季度", "二季度", "三季度", "四季度"],
|
|
70
85
|
"record": "記錄",
|
|
71
86
|
"refresh": "刷新",
|
|
72
87
|
"refreshing": "正在刷新",
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -771,8 +771,9 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
|
|
|
771
771
|
* Try login, returning false means is loading
|
|
772
772
|
* UI get involved while refreshToken not intended
|
|
773
773
|
* @param data Additional request data
|
|
774
|
+
* @param showLoading Show loading bar or not during call
|
|
774
775
|
*/
|
|
775
|
-
tryLogin<D extends {} = {}>(_data?: D): Promise<boolean>;
|
|
776
|
+
tryLogin<D extends {} = {}>(_data?: D, _showLoading?: boolean): Promise<boolean>;
|
|
776
777
|
/**
|
|
777
778
|
* User login
|
|
778
779
|
* @param user User data
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -953,8 +953,9 @@ export class CoreApp {
|
|
|
953
953
|
* Try login, returning false means is loading
|
|
954
954
|
* UI get involved while refreshToken not intended
|
|
955
955
|
* @param data Additional request data
|
|
956
|
+
* @param showLoading Show loading bar or not during call
|
|
956
957
|
*/
|
|
957
|
-
async tryLogin(_data) {
|
|
958
|
+
async tryLogin(_data, _showLoading) {
|
|
958
959
|
if (this._isTryingLogin)
|
|
959
960
|
return false;
|
|
960
961
|
this._isTryingLogin = true;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { IdLabelDto } from '../dto/IdLabelDto';
|
|
2
3
|
import { ICultureGet } from '../state/Culture';
|
|
3
4
|
import { EntityStatus } from './EntityStatus';
|
|
@@ -31,6 +32,13 @@ export declare namespace BusinessUtils {
|
|
|
31
32
|
id: EntityStatus;
|
|
32
33
|
label: string;
|
|
33
34
|
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Get 12-month items
|
|
37
|
+
* @param monthLabels Month labels
|
|
38
|
+
* @param startMonth Start month, 0 as Jan.
|
|
39
|
+
* @returns 12 months
|
|
40
|
+
*/
|
|
41
|
+
function getMonths(monthLabels: string[], startMonth?: number): DataTypes.IdLabelItem[];
|
|
34
42
|
/**
|
|
35
43
|
* Get product unit's label
|
|
36
44
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -52,6 +52,23 @@ export var BusinessUtils;
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
BusinessUtils.getEntityStatus = getEntityStatus;
|
|
55
|
+
/**
|
|
56
|
+
* Get 12-month items
|
|
57
|
+
* @param monthLabels Month labels
|
|
58
|
+
* @param startMonth Start month, 0 as Jan.
|
|
59
|
+
* @returns 12 months
|
|
60
|
+
*/
|
|
61
|
+
function getMonths(monthLabels, startMonth = 0) {
|
|
62
|
+
const months = [];
|
|
63
|
+
for (let i = 0; i < 12; i++) {
|
|
64
|
+
if (startMonth >= 12)
|
|
65
|
+
startMonth = 0;
|
|
66
|
+
months.push({ id: startMonth, label: monthLabels[startMonth] });
|
|
67
|
+
startMonth++;
|
|
68
|
+
}
|
|
69
|
+
return months;
|
|
70
|
+
}
|
|
71
|
+
BusinessUtils.getMonths = getMonths;
|
|
55
72
|
/**
|
|
56
73
|
* Get product unit's label
|
|
57
74
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
package/lib/mjs/i18n/en-US.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "Message",
|
|
51
51
|
"mobile": "Mobile number",
|
|
52
52
|
"mobilePhones": "Mobile numbers",
|
|
53
|
+
"months": [
|
|
54
|
+
"Jan.",
|
|
55
|
+
"Feb.",
|
|
56
|
+
"Mar.",
|
|
57
|
+
"Apr.",
|
|
58
|
+
"May.",
|
|
59
|
+
"Jun.",
|
|
60
|
+
"Jul.",
|
|
61
|
+
"Aug.",
|
|
62
|
+
"Sep.",
|
|
63
|
+
"Oct.",
|
|
64
|
+
"Nov.",
|
|
65
|
+
"Dec."
|
|
66
|
+
],
|
|
53
67
|
"more": "More",
|
|
54
68
|
"moreTag": "{0} more",
|
|
55
69
|
"name": "Name",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "Page Not Found",
|
|
68
82
|
"prompt": "Input",
|
|
69
83
|
"pullToRefresh": "Pull down to refresh",
|
|
84
|
+
"quarters": ["Q1", "Q2", "Q3", "Q4"],
|
|
70
85
|
"record": "Record",
|
|
71
86
|
"refresh": "Refresh",
|
|
72
87
|
"refreshing": "Refreshing",
|
package/lib/mjs/i18n/zh-CN.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "留言",
|
|
51
51
|
"mobile": "手机号码",
|
|
52
52
|
"mobilePhones": "手机号码",
|
|
53
|
+
"months": [
|
|
54
|
+
"1月",
|
|
55
|
+
"2月",
|
|
56
|
+
"3月",
|
|
57
|
+
"4月",
|
|
58
|
+
"5月",
|
|
59
|
+
"6月",
|
|
60
|
+
"7月",
|
|
61
|
+
"8月",
|
|
62
|
+
"9月",
|
|
63
|
+
"10月",
|
|
64
|
+
"11月",
|
|
65
|
+
"12月"
|
|
66
|
+
],
|
|
53
67
|
"more": "更多",
|
|
54
68
|
"moreTag": "({0}+)",
|
|
55
69
|
"name": "姓名",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "找不到页面",
|
|
68
82
|
"prompt": "输入",
|
|
69
83
|
"pullToRefresh": "下拉刷新",
|
|
84
|
+
"quarters": ["一季度", "二季度", "三季度", "四季度"],
|
|
70
85
|
"record": "记录",
|
|
71
86
|
"refresh": "刷新",
|
|
72
87
|
"refreshing": "正在刷新",
|
package/lib/mjs/i18n/zh-HK.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "留言",
|
|
51
51
|
"mobilePhone": "手機號碼",
|
|
52
52
|
"mobilePhones": "手機號碼",
|
|
53
|
+
"months": [
|
|
54
|
+
"1月",
|
|
55
|
+
"2月",
|
|
56
|
+
"3月",
|
|
57
|
+
"4月",
|
|
58
|
+
"5月",
|
|
59
|
+
"6月",
|
|
60
|
+
"7月",
|
|
61
|
+
"8月",
|
|
62
|
+
"9月",
|
|
63
|
+
"10月",
|
|
64
|
+
"11月",
|
|
65
|
+
"12月"
|
|
66
|
+
],
|
|
53
67
|
"more": "更多",
|
|
54
68
|
"moreTag": "({0}+)",
|
|
55
69
|
"name": "姓名",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "找不到頁面",
|
|
68
82
|
"prompt": "輸入",
|
|
69
83
|
"pullToRefresh": "下拉刷新",
|
|
84
|
+
"quarters": ["一季度", "二季度", "三季度", "四季度"],
|
|
70
85
|
"record": "記錄",
|
|
71
86
|
"refresh": "刷新",
|
|
72
87
|
"refreshing": "正在刷新",
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -1706,8 +1706,9 @@ export abstract class CoreApp<
|
|
|
1706
1706
|
* Try login, returning false means is loading
|
|
1707
1707
|
* UI get involved while refreshToken not intended
|
|
1708
1708
|
* @param data Additional request data
|
|
1709
|
+
* @param showLoading Show loading bar or not during call
|
|
1709
1710
|
*/
|
|
1710
|
-
async tryLogin<D extends {} = {}>(_data?: D) {
|
|
1711
|
+
async tryLogin<D extends {} = {}>(_data?: D, _showLoading?: boolean) {
|
|
1711
1712
|
if (this._isTryingLogin) return false;
|
|
1712
1713
|
this._isTryingLogin = true;
|
|
1713
1714
|
return true;
|
|
@@ -56,6 +56,26 @@ export namespace BusinessUtils {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Get 12-month items
|
|
61
|
+
* @param monthLabels Month labels
|
|
62
|
+
* @param startMonth Start month, 0 as Jan.
|
|
63
|
+
* @returns 12 months
|
|
64
|
+
*/
|
|
65
|
+
export function getMonths(monthLabels: string[], startMonth: number = 0) {
|
|
66
|
+
const months: DataTypes.IdLabelItem[] = [];
|
|
67
|
+
|
|
68
|
+
for (let i = 0; i < 12; i++) {
|
|
69
|
+
if (startMonth >= 12) startMonth = 0;
|
|
70
|
+
|
|
71
|
+
months.push({ id: startMonth, label: monthLabels[startMonth] });
|
|
72
|
+
|
|
73
|
+
startMonth++;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return months;
|
|
77
|
+
}
|
|
78
|
+
|
|
59
79
|
/**
|
|
60
80
|
* Get product unit's label
|
|
61
81
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
package/src/i18n/en-US.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "Message",
|
|
51
51
|
"mobile": "Mobile number",
|
|
52
52
|
"mobilePhones": "Mobile numbers",
|
|
53
|
+
"months": [
|
|
54
|
+
"Jan.",
|
|
55
|
+
"Feb.",
|
|
56
|
+
"Mar.",
|
|
57
|
+
"Apr.",
|
|
58
|
+
"May.",
|
|
59
|
+
"Jun.",
|
|
60
|
+
"Jul.",
|
|
61
|
+
"Aug.",
|
|
62
|
+
"Sep.",
|
|
63
|
+
"Oct.",
|
|
64
|
+
"Nov.",
|
|
65
|
+
"Dec."
|
|
66
|
+
],
|
|
53
67
|
"more": "More",
|
|
54
68
|
"moreTag": "{0} more",
|
|
55
69
|
"name": "Name",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "Page Not Found",
|
|
68
82
|
"prompt": "Input",
|
|
69
83
|
"pullToRefresh": "Pull down to refresh",
|
|
84
|
+
"quarters": ["Q1", "Q2", "Q3", "Q4"],
|
|
70
85
|
"record": "Record",
|
|
71
86
|
"refresh": "Refresh",
|
|
72
87
|
"refreshing": "Refreshing",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "留言",
|
|
51
51
|
"mobile": "手机号码",
|
|
52
52
|
"mobilePhones": "手机号码",
|
|
53
|
+
"months": [
|
|
54
|
+
"1月",
|
|
55
|
+
"2月",
|
|
56
|
+
"3月",
|
|
57
|
+
"4月",
|
|
58
|
+
"5月",
|
|
59
|
+
"6月",
|
|
60
|
+
"7月",
|
|
61
|
+
"8月",
|
|
62
|
+
"9月",
|
|
63
|
+
"10月",
|
|
64
|
+
"11月",
|
|
65
|
+
"12月"
|
|
66
|
+
],
|
|
53
67
|
"more": "更多",
|
|
54
68
|
"moreTag": "({0}+)",
|
|
55
69
|
"name": "姓名",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "找不到页面",
|
|
68
82
|
"prompt": "输入",
|
|
69
83
|
"pullToRefresh": "下拉刷新",
|
|
84
|
+
"quarters": ["一季度", "二季度", "三季度", "四季度"],
|
|
70
85
|
"record": "记录",
|
|
71
86
|
"refresh": "刷新",
|
|
72
87
|
"refreshing": "正在刷新",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -50,6 +50,20 @@
|
|
|
50
50
|
"message": "留言",
|
|
51
51
|
"mobilePhone": "手機號碼",
|
|
52
52
|
"mobilePhones": "手機號碼",
|
|
53
|
+
"months": [
|
|
54
|
+
"1月",
|
|
55
|
+
"2月",
|
|
56
|
+
"3月",
|
|
57
|
+
"4月",
|
|
58
|
+
"5月",
|
|
59
|
+
"6月",
|
|
60
|
+
"7月",
|
|
61
|
+
"8月",
|
|
62
|
+
"9月",
|
|
63
|
+
"10月",
|
|
64
|
+
"11月",
|
|
65
|
+
"12月"
|
|
66
|
+
],
|
|
53
67
|
"more": "更多",
|
|
54
68
|
"moreTag": "({0}+)",
|
|
55
69
|
"name": "姓名",
|
|
@@ -67,6 +81,7 @@
|
|
|
67
81
|
"pageNotFound": "找不到頁面",
|
|
68
82
|
"prompt": "輸入",
|
|
69
83
|
"pullToRefresh": "下拉刷新",
|
|
84
|
+
"quarters": ["一季度", "二季度", "三季度", "四季度"],
|
|
70
85
|
"record": "記錄",
|
|
71
86
|
"refresh": "刷新",
|
|
72
87
|
"refreshing": "正在刷新",
|