@etsoo/smarterp-core 1.1.60 → 1.1.61
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/PublicApi.d.ts +9 -0
- package/lib/cjs/PublicApi.js +10 -1
- package/lib/cjs/components/index.d.ts +1 -0
- package/lib/cjs/components/index.js +1 -0
- package/lib/cjs/components/public/TimeZoneList.d.ts +33 -0
- package/lib/cjs/components/public/TimeZoneList.js +27 -0
- package/lib/cjs/dto/public/TimeZoneItem.d.ts +22 -0
- package/lib/cjs/dto/public/TimeZoneItem.js +2 -0
- package/lib/cjs/i18n/en.json +1 -0
- package/lib/cjs/i18n/zh-Hans.json +1 -0
- package/lib/cjs/i18n/zh-Hant.json +1 -0
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/rq/public/TimeZoneRQ.d.ts +14 -0
- package/lib/cjs/rq/public/TimeZoneRQ.js +2 -0
- package/lib/mjs/PublicApi.d.ts +9 -0
- package/lib/mjs/PublicApi.js +10 -1
- package/lib/mjs/components/index.d.ts +1 -0
- package/lib/mjs/components/index.js +1 -0
- package/lib/mjs/components/public/TimeZoneList.d.ts +33 -0
- package/lib/mjs/components/public/TimeZoneList.js +24 -0
- package/lib/mjs/dto/public/TimeZoneItem.d.ts +22 -0
- package/lib/mjs/dto/public/TimeZoneItem.js +1 -0
- package/lib/mjs/i18n/en.json +1 -0
- package/lib/mjs/i18n/zh-Hans.json +1 -0
- package/lib/mjs/i18n/zh-Hant.json +1 -0
- package/lib/mjs/index.d.ts +2 -0
- package/lib/mjs/index.js +2 -0
- package/lib/mjs/rq/public/TimeZoneRQ.d.ts +14 -0
- package/lib/mjs/rq/public/TimeZoneRQ.js +1 -0
- package/package.json +5 -5
- package/src/PublicApi.ts +15 -3
- package/src/components/index.ts +1 -0
- package/src/components/public/TimeZoneList.tsx +82 -0
- package/src/dto/public/TimeZoneItem.ts +25 -0
- package/src/i18n/en.json +1 -0
- package/src/i18n/zh-Hans.json +1 -0
- package/src/i18n/zh-Hant.json +1 -0
- package/src/index.ts +2 -0
- package/src/rq/public/TimeZoneRQ.ts +16 -0
package/lib/cjs/PublicApi.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
|
|
|
12
12
|
import { ChinaPinData } from "./dto/public/ChinaPinData";
|
|
13
13
|
import { ParseNameRQ } from "./rq/public/ParseNameRQ";
|
|
14
14
|
import { NameData } from "./dto/public/NameData";
|
|
15
|
+
import { TimeZoneItem } from "./dto/public/TimeZoneItem";
|
|
16
|
+
import { TimeZoneRQ } from "./rq/public/TimeZoneRQ";
|
|
15
17
|
/**
|
|
16
18
|
* Public API
|
|
17
19
|
* 公共接口
|
|
@@ -78,6 +80,13 @@ export declare class PublicApi extends BaseApi {
|
|
|
78
80
|
* @returns Result
|
|
79
81
|
*/
|
|
80
82
|
getRegions(ids?: string[], payload?: IApiPayload<RegionData[]>): Promise<RegionData[] | undefined>;
|
|
83
|
+
/**
|
|
84
|
+
* Get time zones
|
|
85
|
+
* @param rq Request data
|
|
86
|
+
* @param payload Payload
|
|
87
|
+
* @returns Result
|
|
88
|
+
*/
|
|
89
|
+
getTimeZones(rq?: TimeZoneRQ, payload?: IApiPayload<TimeZoneItem[]>): Promise<TimeZoneItem[] | undefined>;
|
|
81
90
|
/**
|
|
82
91
|
* Get product unit's label
|
|
83
92
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
package/lib/cjs/PublicApi.js
CHANGED
|
@@ -98,6 +98,15 @@ class PublicApi extends appscript_1.BaseApi {
|
|
|
98
98
|
contentType: "application/json"
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Get time zones
|
|
103
|
+
* @param rq Request data
|
|
104
|
+
* @param payload Payload
|
|
105
|
+
* @returns Result
|
|
106
|
+
*/
|
|
107
|
+
getTimeZones(rq, payload) {
|
|
108
|
+
return this.api.post("Public/GetTimeZones", rq, payload);
|
|
109
|
+
}
|
|
101
110
|
/**
|
|
102
111
|
* Get product unit's label
|
|
103
112
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -116,7 +125,7 @@ class PublicApi extends appscript_1.BaseApi {
|
|
|
116
125
|
}
|
|
117
126
|
getUnitJoin(isJoined) {
|
|
118
127
|
return typeof isJoined === "string"
|
|
119
|
-
? this.app.get(isJoined) ?? isJoined
|
|
128
|
+
? (this.app.get(isJoined) ?? isJoined)
|
|
120
129
|
: isJoined
|
|
121
130
|
? this.app.get("unitJoin")
|
|
122
131
|
: undefined;
|
|
@@ -39,5 +39,6 @@ __exportStar(require("./public/ButtonRadioRegions"), exports);
|
|
|
39
39
|
__exportStar(require("./public/ButtonRegions"), exports);
|
|
40
40
|
__exportStar(require("./public/CultureList"), exports);
|
|
41
41
|
__exportStar(require("./public/ProductBaseUnits"), exports);
|
|
42
|
+
__exportStar(require("./public/TimeZoneList"), exports);
|
|
42
43
|
// user
|
|
43
44
|
__exportStar(require("./user/UserTiplist"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TiplistProps } from "@etsoo/materialui";
|
|
2
|
+
import { TimeZoneItem } from "../../dto/public/TimeZoneItem";
|
|
3
|
+
import { TimeZoneRQ } from "../../rq/public/TimeZoneRQ";
|
|
4
|
+
/**
|
|
5
|
+
* Time zone tiplist properties
|
|
6
|
+
* 时区提示列表属性
|
|
7
|
+
*/
|
|
8
|
+
export type TimeZoneTiplistProps = Omit<TiplistProps<TimeZoneItem, "id">, "loadData" | "label" | "name"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Label
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Default request data
|
|
19
|
+
*/
|
|
20
|
+
rq?: Partial<TimeZoneRQ>;
|
|
21
|
+
/**
|
|
22
|
+
* Load data handler
|
|
23
|
+
* @param rq Request data
|
|
24
|
+
*/
|
|
25
|
+
onLoadData?: (rq: TimeZoneRQ) => TimeZoneRQ;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Time zone tiplist
|
|
29
|
+
* 时区提示列表
|
|
30
|
+
* @param props Properties
|
|
31
|
+
* @returns Component
|
|
32
|
+
*/
|
|
33
|
+
export declare function TimeZoneTiplist(props: TimeZoneTiplistProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimeZoneTiplist = TimeZoneTiplist;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const materialui_1 = require("@etsoo/materialui");
|
|
6
|
+
const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
7
|
+
/**
|
|
8
|
+
* Time zone tiplist
|
|
9
|
+
* 时区提示列表
|
|
10
|
+
* @param props Properties
|
|
11
|
+
* @returns Component
|
|
12
|
+
*/
|
|
13
|
+
function TimeZoneTiplist(props) {
|
|
14
|
+
// App
|
|
15
|
+
const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
|
|
16
|
+
// Destruct
|
|
17
|
+
const { fullWidth = true, label = app.get("timeZone"), maxItems = 10, getOptionLabel = (data) => data.displayName, onLoadData = (rq) => rq, name = "timeZone", rq = { enabled: true }, ...rest } = props;
|
|
18
|
+
// Layout
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(materialui_1.Tiplist, { label: label, getOptionLabel: getOptionLabel, name: name, fullWidth: fullWidth, maxItems: maxItems, loadData: (keyword, id, maxItems) => app.core.publicApi.getTimeZones(onLoadData({
|
|
20
|
+
...rq,
|
|
21
|
+
keyword,
|
|
22
|
+
id,
|
|
23
|
+
queryPaging: {
|
|
24
|
+
batchSize: maxItems
|
|
25
|
+
}
|
|
26
|
+
}), { showLoading: false, defaultValue: [] }), ...rest }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TimeZoneItem = {
|
|
2
|
+
/**
|
|
3
|
+
* IANA Id
|
|
4
|
+
* IANA 编号
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Display name
|
|
9
|
+
* 显示名称
|
|
10
|
+
*/
|
|
11
|
+
displayName: string;
|
|
12
|
+
/**
|
|
13
|
+
* Standard name
|
|
14
|
+
* 标准名称
|
|
15
|
+
*/
|
|
16
|
+
standardName: string;
|
|
17
|
+
/**
|
|
18
|
+
* UTC offset
|
|
19
|
+
* UTC偏移
|
|
20
|
+
*/
|
|
21
|
+
utcOffset: string;
|
|
22
|
+
};
|
package/lib/cjs/i18n/en.json
CHANGED
|
@@ -133,6 +133,7 @@
|
|
|
133
133
|
"templateCMSPODATA": "CMS PO data",
|
|
134
134
|
"templateCMSSTOCKDATA": "CMS stock data",
|
|
135
135
|
"templateKind": "Template kind",
|
|
136
|
+
"timeZone": "Time zone",
|
|
136
137
|
"years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
|
|
137
138
|
"uiTypeEmail": "Email",
|
|
138
139
|
"uiTypeMobile": "Mobile",
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./dto/public/MemberInvitationDto";
|
|
|
34
34
|
export * from "./dto/public/NameData";
|
|
35
35
|
export * from "./dto/public/PlaceCommon";
|
|
36
36
|
export * from "./dto/public/RegionData";
|
|
37
|
+
export * from "./dto/public/TimeZoneItem";
|
|
37
38
|
export * from "./dto/user/AuditHistoryDto";
|
|
38
39
|
export * from "./dto/user/DeviceListDto";
|
|
39
40
|
export * from "./dto/user/UserIdentifierData";
|
|
@@ -79,6 +80,7 @@ export * from "./rq/public/CreateBarcodeRQ";
|
|
|
79
80
|
export * from "./rq/public/ParseNameRQ";
|
|
80
81
|
export * from "./rq/public/PinyinRQ";
|
|
81
82
|
export * from "./rq/public/PlaceQueryRQ";
|
|
83
|
+
export * from "./rq/public/TimeZoneRQ";
|
|
82
84
|
export * from "./rq/user/AuditHistoryRQ";
|
|
83
85
|
export * from "./rq/user/UserUpdateRQ";
|
|
84
86
|
export * from "./AppApi";
|
package/lib/cjs/index.js
CHANGED
|
@@ -51,6 +51,7 @@ __exportStar(require("./dto/public/MemberInvitationDto"), exports);
|
|
|
51
51
|
__exportStar(require("./dto/public/NameData"), exports);
|
|
52
52
|
__exportStar(require("./dto/public/PlaceCommon"), exports);
|
|
53
53
|
__exportStar(require("./dto/public/RegionData"), exports);
|
|
54
|
+
__exportStar(require("./dto/public/TimeZoneItem"), exports);
|
|
54
55
|
__exportStar(require("./dto/user/AuditHistoryDto"), exports);
|
|
55
56
|
__exportStar(require("./dto/user/DeviceListDto"), exports);
|
|
56
57
|
__exportStar(require("./dto/user/UserIdentifierData"), exports);
|
|
@@ -98,6 +99,7 @@ __exportStar(require("./rq/public/CreateBarcodeRQ"), exports);
|
|
|
98
99
|
__exportStar(require("./rq/public/ParseNameRQ"), exports);
|
|
99
100
|
__exportStar(require("./rq/public/PinyinRQ"), exports);
|
|
100
101
|
__exportStar(require("./rq/public/PlaceQueryRQ"), exports);
|
|
102
|
+
__exportStar(require("./rq/public/TimeZoneRQ"), exports);
|
|
101
103
|
__exportStar(require("./rq/user/AuditHistoryRQ"), exports);
|
|
102
104
|
__exportStar(require("./rq/user/UserUpdateRQ"), exports);
|
|
103
105
|
// APIs
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryRQ } from "@etsoo/appscript";
|
|
2
|
+
export type TimeZoneRQ = QueryRQ<string> & {
|
|
3
|
+
/**
|
|
4
|
+
* Culture, like "en-US", "zh-CN", etc.
|
|
5
|
+
* If not specified, the current culture will be used.
|
|
6
|
+
* 文化
|
|
7
|
+
*/
|
|
8
|
+
culture?: string;
|
|
9
|
+
/**
|
|
10
|
+
* All system timezones
|
|
11
|
+
* 所有系统时区
|
|
12
|
+
*/
|
|
13
|
+
all?: boolean;
|
|
14
|
+
};
|
package/lib/mjs/PublicApi.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
|
|
|
12
12
|
import { ChinaPinData } from "./dto/public/ChinaPinData";
|
|
13
13
|
import { ParseNameRQ } from "./rq/public/ParseNameRQ";
|
|
14
14
|
import { NameData } from "./dto/public/NameData";
|
|
15
|
+
import { TimeZoneItem } from "./dto/public/TimeZoneItem";
|
|
16
|
+
import { TimeZoneRQ } from "./rq/public/TimeZoneRQ";
|
|
15
17
|
/**
|
|
16
18
|
* Public API
|
|
17
19
|
* 公共接口
|
|
@@ -78,6 +80,13 @@ export declare class PublicApi extends BaseApi {
|
|
|
78
80
|
* @returns Result
|
|
79
81
|
*/
|
|
80
82
|
getRegions(ids?: string[], payload?: IApiPayload<RegionData[]>): Promise<RegionData[] | undefined>;
|
|
83
|
+
/**
|
|
84
|
+
* Get time zones
|
|
85
|
+
* @param rq Request data
|
|
86
|
+
* @param payload Payload
|
|
87
|
+
* @returns Result
|
|
88
|
+
*/
|
|
89
|
+
getTimeZones(rq?: TimeZoneRQ, payload?: IApiPayload<TimeZoneItem[]>): Promise<TimeZoneItem[] | undefined>;
|
|
81
90
|
/**
|
|
82
91
|
* Get product unit's label
|
|
83
92
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
package/lib/mjs/PublicApi.js
CHANGED
|
@@ -95,6 +95,15 @@ export class PublicApi extends BaseApi {
|
|
|
95
95
|
contentType: "application/json"
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Get time zones
|
|
100
|
+
* @param rq Request data
|
|
101
|
+
* @param payload Payload
|
|
102
|
+
* @returns Result
|
|
103
|
+
*/
|
|
104
|
+
getTimeZones(rq, payload) {
|
|
105
|
+
return this.api.post("Public/GetTimeZones", rq, payload);
|
|
106
|
+
}
|
|
98
107
|
/**
|
|
99
108
|
* Get product unit's label
|
|
100
109
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -113,7 +122,7 @@ export class PublicApi extends BaseApi {
|
|
|
113
122
|
}
|
|
114
123
|
getUnitJoin(isJoined) {
|
|
115
124
|
return typeof isJoined === "string"
|
|
116
|
-
? this.app.get(isJoined) ?? isJoined
|
|
125
|
+
? (this.app.get(isJoined) ?? isJoined)
|
|
117
126
|
: isJoined
|
|
118
127
|
? this.app.get("unitJoin")
|
|
119
128
|
: undefined;
|
|
@@ -23,5 +23,6 @@ export * from "./public/ButtonRadioRegions";
|
|
|
23
23
|
export * from "./public/ButtonRegions";
|
|
24
24
|
export * from "./public/CultureList";
|
|
25
25
|
export * from "./public/ProductBaseUnits";
|
|
26
|
+
export * from "./public/TimeZoneList";
|
|
26
27
|
// user
|
|
27
28
|
export * from "./user/UserTiplist";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TiplistProps } from "@etsoo/materialui";
|
|
2
|
+
import { TimeZoneItem } from "../../dto/public/TimeZoneItem";
|
|
3
|
+
import { TimeZoneRQ } from "../../rq/public/TimeZoneRQ";
|
|
4
|
+
/**
|
|
5
|
+
* Time zone tiplist properties
|
|
6
|
+
* 时区提示列表属性
|
|
7
|
+
*/
|
|
8
|
+
export type TimeZoneTiplistProps = Omit<TiplistProps<TimeZoneItem, "id">, "loadData" | "label" | "name"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Label
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Default request data
|
|
19
|
+
*/
|
|
20
|
+
rq?: Partial<TimeZoneRQ>;
|
|
21
|
+
/**
|
|
22
|
+
* Load data handler
|
|
23
|
+
* @param rq Request data
|
|
24
|
+
*/
|
|
25
|
+
onLoadData?: (rq: TimeZoneRQ) => TimeZoneRQ;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Time zone tiplist
|
|
29
|
+
* 时区提示列表
|
|
30
|
+
* @param props Properties
|
|
31
|
+
* @returns Component
|
|
32
|
+
*/
|
|
33
|
+
export declare function TimeZoneTiplist(props: TimeZoneTiplistProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tiplist } from "@etsoo/materialui";
|
|
3
|
+
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
4
|
+
/**
|
|
5
|
+
* Time zone tiplist
|
|
6
|
+
* 时区提示列表
|
|
7
|
+
* @param props Properties
|
|
8
|
+
* @returns Component
|
|
9
|
+
*/
|
|
10
|
+
export function TimeZoneTiplist(props) {
|
|
11
|
+
// App
|
|
12
|
+
const app = useRequiredAppContext();
|
|
13
|
+
// Destruct
|
|
14
|
+
const { fullWidth = true, label = app.get("timeZone"), maxItems = 10, getOptionLabel = (data) => data.displayName, onLoadData = (rq) => rq, name = "timeZone", rq = { enabled: true }, ...rest } = props;
|
|
15
|
+
// Layout
|
|
16
|
+
return (_jsx(Tiplist, { label: label, getOptionLabel: getOptionLabel, name: name, fullWidth: fullWidth, maxItems: maxItems, loadData: (keyword, id, maxItems) => app.core.publicApi.getTimeZones(onLoadData({
|
|
17
|
+
...rq,
|
|
18
|
+
keyword,
|
|
19
|
+
id,
|
|
20
|
+
queryPaging: {
|
|
21
|
+
batchSize: maxItems
|
|
22
|
+
}
|
|
23
|
+
}), { showLoading: false, defaultValue: [] }), ...rest }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TimeZoneItem = {
|
|
2
|
+
/**
|
|
3
|
+
* IANA Id
|
|
4
|
+
* IANA 编号
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Display name
|
|
9
|
+
* 显示名称
|
|
10
|
+
*/
|
|
11
|
+
displayName: string;
|
|
12
|
+
/**
|
|
13
|
+
* Standard name
|
|
14
|
+
* 标准名称
|
|
15
|
+
*/
|
|
16
|
+
standardName: string;
|
|
17
|
+
/**
|
|
18
|
+
* UTC offset
|
|
19
|
+
* UTC偏移
|
|
20
|
+
*/
|
|
21
|
+
utcOffset: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/mjs/i18n/en.json
CHANGED
|
@@ -133,6 +133,7 @@
|
|
|
133
133
|
"templateCMSPODATA": "CMS PO data",
|
|
134
134
|
"templateCMSSTOCKDATA": "CMS stock data",
|
|
135
135
|
"templateKind": "Template kind",
|
|
136
|
+
"timeZone": "Time zone",
|
|
136
137
|
"years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
|
|
137
138
|
"uiTypeEmail": "Email",
|
|
138
139
|
"uiTypeMobile": "Mobile",
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./dto/public/MemberInvitationDto";
|
|
|
34
34
|
export * from "./dto/public/NameData";
|
|
35
35
|
export * from "./dto/public/PlaceCommon";
|
|
36
36
|
export * from "./dto/public/RegionData";
|
|
37
|
+
export * from "./dto/public/TimeZoneItem";
|
|
37
38
|
export * from "./dto/user/AuditHistoryDto";
|
|
38
39
|
export * from "./dto/user/DeviceListDto";
|
|
39
40
|
export * from "./dto/user/UserIdentifierData";
|
|
@@ -79,6 +80,7 @@ export * from "./rq/public/CreateBarcodeRQ";
|
|
|
79
80
|
export * from "./rq/public/ParseNameRQ";
|
|
80
81
|
export * from "./rq/public/PinyinRQ";
|
|
81
82
|
export * from "./rq/public/PlaceQueryRQ";
|
|
83
|
+
export * from "./rq/public/TimeZoneRQ";
|
|
82
84
|
export * from "./rq/user/AuditHistoryRQ";
|
|
83
85
|
export * from "./rq/user/UserUpdateRQ";
|
|
84
86
|
export * from "./AppApi";
|
package/lib/mjs/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export * from "./dto/public/MemberInvitationDto";
|
|
|
35
35
|
export * from "./dto/public/NameData";
|
|
36
36
|
export * from "./dto/public/PlaceCommon";
|
|
37
37
|
export * from "./dto/public/RegionData";
|
|
38
|
+
export * from "./dto/public/TimeZoneItem";
|
|
38
39
|
export * from "./dto/user/AuditHistoryDto";
|
|
39
40
|
export * from "./dto/user/DeviceListDto";
|
|
40
41
|
export * from "./dto/user/UserIdentifierData";
|
|
@@ -82,6 +83,7 @@ export * from "./rq/public/CreateBarcodeRQ";
|
|
|
82
83
|
export * from "./rq/public/ParseNameRQ";
|
|
83
84
|
export * from "./rq/public/PinyinRQ";
|
|
84
85
|
export * from "./rq/public/PlaceQueryRQ";
|
|
86
|
+
export * from "./rq/public/TimeZoneRQ";
|
|
85
87
|
export * from "./rq/user/AuditHistoryRQ";
|
|
86
88
|
export * from "./rq/user/UserUpdateRQ";
|
|
87
89
|
// APIs
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryRQ } from "@etsoo/appscript";
|
|
2
|
+
export type TimeZoneRQ = QueryRQ<string> & {
|
|
3
|
+
/**
|
|
4
|
+
* Culture, like "en-US", "zh-CN", etc.
|
|
5
|
+
* If not specified, the current culture will be used.
|
|
6
|
+
* 文化
|
|
7
|
+
*/
|
|
8
|
+
culture?: string;
|
|
9
|
+
/**
|
|
10
|
+
* All system timezones
|
|
11
|
+
* 所有系统时区
|
|
12
|
+
*/
|
|
13
|
+
all?: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/smarterp-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.61",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"homepage": "https://github.com/ETSOO/smarterp-core#readme",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@babel/core": "^
|
|
44
|
-
"@babel/plugin-transform-runtime": "^
|
|
45
|
-
"@babel/preset-env": "^
|
|
46
|
-
"@babel/runtime-corejs3": "^
|
|
43
|
+
"@babel/core": "^8.0.1",
|
|
44
|
+
"@babel/plugin-transform-runtime": "^8.0.1",
|
|
45
|
+
"@babel/preset-env": "^8.0.1",
|
|
46
|
+
"@babel/runtime-corejs3": "^8.0.0",
|
|
47
47
|
"@types/react": "^19.2.17",
|
|
48
48
|
"@types/react-dom": "^19.2.3",
|
|
49
49
|
"@vitejs/plugin-react": "^6.0.2",
|
package/src/PublicApi.ts
CHANGED
|
@@ -22,6 +22,8 @@ import { AcceptInvitationRQ } from "./rq/public/AcceptInvitationRQ";
|
|
|
22
22
|
import { ChinaPinData } from "./dto/public/ChinaPinData";
|
|
23
23
|
import { ParseNameRQ } from "./rq/public/ParseNameRQ";
|
|
24
24
|
import { NameData } from "./dto/public/NameData";
|
|
25
|
+
import { TimeZoneItem } from "./dto/public/TimeZoneItem";
|
|
26
|
+
import { TimeZoneRQ } from "./rq/public/TimeZoneRQ";
|
|
25
27
|
|
|
26
28
|
const unitPrefix = "unit";
|
|
27
29
|
|
|
@@ -132,6 +134,16 @@ export class PublicApi extends BaseApi {
|
|
|
132
134
|
});
|
|
133
135
|
}
|
|
134
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Get time zones
|
|
139
|
+
* @param rq Request data
|
|
140
|
+
* @param payload Payload
|
|
141
|
+
* @returns Result
|
|
142
|
+
*/
|
|
143
|
+
getTimeZones(rq?: TimeZoneRQ, payload?: IApiPayload<TimeZoneItem[]>) {
|
|
144
|
+
return this.api.post("Public/GetTimeZones", rq, payload);
|
|
145
|
+
}
|
|
146
|
+
|
|
135
147
|
/**
|
|
136
148
|
* Get product unit's label
|
|
137
149
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -151,10 +163,10 @@ export class PublicApi extends BaseApi {
|
|
|
151
163
|
|
|
152
164
|
private getUnitJoin(isJoined: boolean | string | undefined) {
|
|
153
165
|
return typeof isJoined === "string"
|
|
154
|
-
? this.app.get(isJoined) ?? isJoined
|
|
166
|
+
? (this.app.get(isJoined) ?? isJoined)
|
|
155
167
|
: isJoined
|
|
156
|
-
|
|
157
|
-
|
|
168
|
+
? this.app.get("unitJoin")
|
|
169
|
+
: undefined;
|
|
158
170
|
}
|
|
159
171
|
|
|
160
172
|
/**
|
package/src/components/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from "./public/ButtonRadioRegions";
|
|
|
27
27
|
export * from "./public/ButtonRegions";
|
|
28
28
|
export * from "./public/CultureList";
|
|
29
29
|
export * from "./public/ProductBaseUnits";
|
|
30
|
+
export * from "./public/TimeZoneList";
|
|
30
31
|
|
|
31
32
|
// user
|
|
32
33
|
export * from "./user/UserTiplist";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Tiplist, TiplistProps } from "@etsoo/materialui";
|
|
2
|
+
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
3
|
+
import { TimeZoneItem } from "../../dto/public/TimeZoneItem";
|
|
4
|
+
import { TimeZoneRQ } from "../../rq/public/TimeZoneRQ";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Time zone tiplist properties
|
|
8
|
+
* 时区提示列表属性
|
|
9
|
+
*/
|
|
10
|
+
export type TimeZoneTiplistProps = Omit<
|
|
11
|
+
TiplistProps<TimeZoneItem, "id">,
|
|
12
|
+
"loadData" | "label" | "name"
|
|
13
|
+
> & {
|
|
14
|
+
/**
|
|
15
|
+
* Label
|
|
16
|
+
*/
|
|
17
|
+
label?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Name
|
|
21
|
+
*/
|
|
22
|
+
name?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Default request data
|
|
26
|
+
*/
|
|
27
|
+
rq?: Partial<TimeZoneRQ>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Load data handler
|
|
31
|
+
* @param rq Request data
|
|
32
|
+
*/
|
|
33
|
+
onLoadData?: (rq: TimeZoneRQ) => TimeZoneRQ;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Time zone tiplist
|
|
38
|
+
* 时区提示列表
|
|
39
|
+
* @param props Properties
|
|
40
|
+
* @returns Component
|
|
41
|
+
*/
|
|
42
|
+
export function TimeZoneTiplist(props: TimeZoneTiplistProps) {
|
|
43
|
+
// App
|
|
44
|
+
const app = useRequiredAppContext();
|
|
45
|
+
|
|
46
|
+
// Destruct
|
|
47
|
+
const {
|
|
48
|
+
fullWidth = true,
|
|
49
|
+
label = app.get("timeZone")!,
|
|
50
|
+
maxItems = 10,
|
|
51
|
+
getOptionLabel = (data) => data.displayName,
|
|
52
|
+
onLoadData = (rq) => rq,
|
|
53
|
+
name = "timeZone",
|
|
54
|
+
rq = { enabled: true },
|
|
55
|
+
...rest
|
|
56
|
+
} = props;
|
|
57
|
+
|
|
58
|
+
// Layout
|
|
59
|
+
return (
|
|
60
|
+
<Tiplist<TimeZoneItem, "id">
|
|
61
|
+
label={label}
|
|
62
|
+
getOptionLabel={getOptionLabel}
|
|
63
|
+
name={name}
|
|
64
|
+
fullWidth={fullWidth}
|
|
65
|
+
maxItems={maxItems}
|
|
66
|
+
loadData={(keyword, id, maxItems) =>
|
|
67
|
+
app.core.publicApi.getTimeZones(
|
|
68
|
+
onLoadData({
|
|
69
|
+
...rq,
|
|
70
|
+
keyword,
|
|
71
|
+
id,
|
|
72
|
+
queryPaging: {
|
|
73
|
+
batchSize: maxItems
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
{ showLoading: false, defaultValue: [] }
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
{...rest}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type TimeZoneItem = {
|
|
2
|
+
/**
|
|
3
|
+
* IANA Id
|
|
4
|
+
* IANA 编号
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Display name
|
|
10
|
+
* 显示名称
|
|
11
|
+
*/
|
|
12
|
+
displayName: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Standard name
|
|
16
|
+
* 标准名称
|
|
17
|
+
*/
|
|
18
|
+
standardName: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* UTC offset
|
|
22
|
+
* UTC偏移
|
|
23
|
+
*/
|
|
24
|
+
utcOffset: string;
|
|
25
|
+
};
|
package/src/i18n/en.json
CHANGED
|
@@ -133,6 +133,7 @@
|
|
|
133
133
|
"templateCMSPODATA": "CMS PO data",
|
|
134
134
|
"templateCMSSTOCKDATA": "CMS stock data",
|
|
135
135
|
"templateKind": "Template kind",
|
|
136
|
+
"timeZone": "Time zone",
|
|
136
137
|
"years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
|
|
137
138
|
"uiTypeEmail": "Email",
|
|
138
139
|
"uiTypeMobile": "Mobile",
|
package/src/i18n/zh-Hans.json
CHANGED
package/src/i18n/zh-Hant.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from "./dto/public/MemberInvitationDto";
|
|
|
40
40
|
export * from "./dto/public/NameData";
|
|
41
41
|
export * from "./dto/public/PlaceCommon";
|
|
42
42
|
export * from "./dto/public/RegionData";
|
|
43
|
+
export * from "./dto/public/TimeZoneItem";
|
|
43
44
|
|
|
44
45
|
export * from "./dto/user/AuditHistoryDto";
|
|
45
46
|
export * from "./dto/user/DeviceListDto";
|
|
@@ -95,6 +96,7 @@ export * from "./rq/public/CreateBarcodeRQ";
|
|
|
95
96
|
export * from "./rq/public/ParseNameRQ";
|
|
96
97
|
export * from "./rq/public/PinyinRQ";
|
|
97
98
|
export * from "./rq/public/PlaceQueryRQ";
|
|
99
|
+
export * from "./rq/public/TimeZoneRQ";
|
|
98
100
|
|
|
99
101
|
export * from "./rq/user/AuditHistoryRQ";
|
|
100
102
|
export * from "./rq/user/UserUpdateRQ";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { QueryRQ } from "@etsoo/appscript";
|
|
2
|
+
|
|
3
|
+
export type TimeZoneRQ = QueryRQ<string> & {
|
|
4
|
+
/**
|
|
5
|
+
* Culture, like "en-US", "zh-CN", etc.
|
|
6
|
+
* If not specified, the current culture will be used.
|
|
7
|
+
* 文化
|
|
8
|
+
*/
|
|
9
|
+
culture?: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* All system timezones
|
|
13
|
+
* 所有系统时区
|
|
14
|
+
*/
|
|
15
|
+
all?: boolean;
|
|
16
|
+
};
|