@etsoo/smarterp-core 1.1.60 → 1.1.62

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.
Files changed (52) hide show
  1. package/lib/cjs/PublicApi.d.ts +9 -0
  2. package/lib/cjs/PublicApi.js +10 -1
  3. package/lib/cjs/components/index.d.ts +1 -0
  4. package/lib/cjs/components/index.js +1 -0
  5. package/lib/cjs/components/public/TimeZoneTiplist.d.ts +33 -0
  6. package/lib/cjs/components/public/TimeZoneTiplist.js +27 -0
  7. package/lib/cjs/dto/org/OrgUpdateReadDto.d.ts +5 -0
  8. package/lib/cjs/dto/public/TimeZoneItem.d.ts +22 -0
  9. package/lib/cjs/dto/public/TimeZoneItem.js +2 -0
  10. package/lib/cjs/i18n/en.json +1 -0
  11. package/lib/cjs/i18n/zh-Hans.json +1 -0
  12. package/lib/cjs/i18n/zh-Hant.json +1 -0
  13. package/lib/cjs/index.d.ts +2 -0
  14. package/lib/cjs/index.js +2 -0
  15. package/lib/cjs/rq/app/AppBuyNewRQ.d.ts +5 -0
  16. package/lib/cjs/rq/org/OrgCreateRQ.d.ts +5 -0
  17. package/lib/cjs/rq/org/OrgUpdateRQ.d.ts +5 -0
  18. package/lib/cjs/rq/public/TimeZoneRQ.d.ts +14 -0
  19. package/lib/cjs/rq/public/TimeZoneRQ.js +2 -0
  20. package/lib/mjs/PublicApi.d.ts +9 -0
  21. package/lib/mjs/PublicApi.js +10 -1
  22. package/lib/mjs/components/index.d.ts +1 -0
  23. package/lib/mjs/components/index.js +1 -0
  24. package/lib/mjs/components/public/TimeZoneTiplist.d.ts +33 -0
  25. package/lib/mjs/components/public/TimeZoneTiplist.js +24 -0
  26. package/lib/mjs/dto/org/OrgUpdateReadDto.d.ts +5 -0
  27. package/lib/mjs/dto/public/TimeZoneItem.d.ts +22 -0
  28. package/lib/mjs/dto/public/TimeZoneItem.js +1 -0
  29. package/lib/mjs/i18n/en.json +1 -0
  30. package/lib/mjs/i18n/zh-Hans.json +1 -0
  31. package/lib/mjs/i18n/zh-Hant.json +1 -0
  32. package/lib/mjs/index.d.ts +2 -0
  33. package/lib/mjs/index.js +2 -0
  34. package/lib/mjs/rq/app/AppBuyNewRQ.d.ts +5 -0
  35. package/lib/mjs/rq/org/OrgCreateRQ.d.ts +5 -0
  36. package/lib/mjs/rq/org/OrgUpdateRQ.d.ts +5 -0
  37. package/lib/mjs/rq/public/TimeZoneRQ.d.ts +14 -0
  38. package/lib/mjs/rq/public/TimeZoneRQ.js +1 -0
  39. package/package.json +5 -5
  40. package/src/PublicApi.ts +15 -3
  41. package/src/components/index.ts +1 -0
  42. package/src/components/public/TimeZoneTiplist.tsx +82 -0
  43. package/src/dto/org/OrgUpdateReadDto.ts +6 -0
  44. package/src/dto/public/TimeZoneItem.ts +25 -0
  45. package/src/i18n/en.json +1 -0
  46. package/src/i18n/zh-Hans.json +1 -0
  47. package/src/i18n/zh-Hant.json +1 -0
  48. package/src/index.ts +2 -0
  49. package/src/rq/app/AppBuyNewRQ.ts +6 -0
  50. package/src/rq/org/OrgCreateRQ.ts +6 -0
  51. package/src/rq/org/OrgUpdateRQ.ts +6 -0
  52. package/src/rq/public/TimeZoneRQ.ts +16 -0
@@ -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
@@ -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;
@@ -18,4 +18,5 @@ export * from "./public/ButtonRadioRegions";
18
18
  export * from "./public/ButtonRegions";
19
19
  export * from "./public/CultureList";
20
20
  export * from "./public/ProductBaseUnits";
21
+ export * from "./public/TimeZoneTiplist";
21
22
  export * from "./user/UserTiplist";
@@ -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/TimeZoneTiplist"), 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
+ }
@@ -36,4 +36,9 @@ export type OrgUpdateReadDto = {
36
36
  * Query Keyword
37
37
  */
38
38
  queryKeyword?: string;
39
+ /**
40
+ * Time zone
41
+ * 时区
42
+ */
43
+ timeZone?: string;
39
44
  };
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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",
@@ -133,6 +133,7 @@
133
133
  "templateCMSPODATA": "CMS采购数据",
134
134
  "templateCMSSTOCKDATA": "CMS库存数据",
135
135
  "templateKind": "模板类型",
136
+ "timeZone": "时区",
136
137
  "years5": ["1年", "2年", "3年", "4年", "5年"],
137
138
  "uiTypeEmail": "电子邮箱",
138
139
  "uiTypeMobile": "手机号",
@@ -133,6 +133,7 @@
133
133
  "templateCMSPODATA": "CMS採購數據",
134
134
  "templateCMSSTOCKDATA": "CMS庫存數據",
135
135
  "templateKind": "模板類型",
136
+ "timeZone": "時區",
136
137
  "years5": ["1年", "2年", "3年", "4年", "5年"],
137
138
  "uiTypeEmail": "電子郵件",
138
139
  "uiTypeMobile": "手機號碼",
@@ -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
@@ -23,4 +23,9 @@ export type AppBuyNewRQ = {
23
23
  * 所在区域
24
24
  */
25
25
  region: string;
26
+ /**
27
+ * Time zone
28
+ * 时区
29
+ */
30
+ timeZone?: string;
26
31
  };
@@ -43,4 +43,9 @@ export type OrgCreateRQ = {
43
43
  * 所在区域
44
44
  */
45
45
  region: string;
46
+ /**
47
+ * Time zone
48
+ * 时区
49
+ */
50
+ timeZone?: string;
46
51
  };
@@ -38,4 +38,9 @@ export interface OrgUpdateRQ extends UpdateModel {
38
38
  * 查询关键字
39
39
  */
40
40
  queryKeyword?: string;
41
+ /**
42
+ * Time zone
43
+ * 时区
44
+ */
45
+ timeZone?: string;
41
46
  }
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
@@ -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;
@@ -18,4 +18,5 @@ export * from "./public/ButtonRadioRegions";
18
18
  export * from "./public/ButtonRegions";
19
19
  export * from "./public/CultureList";
20
20
  export * from "./public/ProductBaseUnits";
21
+ export * from "./public/TimeZoneTiplist";
21
22
  export * from "./user/UserTiplist";
@@ -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/TimeZoneTiplist";
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
+ }
@@ -36,4 +36,9 @@ export type OrgUpdateReadDto = {
36
36
  * Query Keyword
37
37
  */
38
38
  queryKeyword?: string;
39
+ /**
40
+ * Time zone
41
+ * 时区
42
+ */
43
+ timeZone?: string;
39
44
  };
@@ -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 {};
@@ -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",
@@ -133,6 +133,7 @@
133
133
  "templateCMSPODATA": "CMS采购数据",
134
134
  "templateCMSSTOCKDATA": "CMS库存数据",
135
135
  "templateKind": "模板类型",
136
+ "timeZone": "时区",
136
137
  "years5": ["1年", "2年", "3年", "4年", "5年"],
137
138
  "uiTypeEmail": "电子邮箱",
138
139
  "uiTypeMobile": "手机号",
@@ -133,6 +133,7 @@
133
133
  "templateCMSPODATA": "CMS採購數據",
134
134
  "templateCMSSTOCKDATA": "CMS庫存數據",
135
135
  "templateKind": "模板類型",
136
+ "timeZone": "時區",
136
137
  "years5": ["1年", "2年", "3年", "4年", "5年"],
137
138
  "uiTypeEmail": "電子郵件",
138
139
  "uiTypeMobile": "手機號碼",
@@ -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
@@ -23,4 +23,9 @@ export type AppBuyNewRQ = {
23
23
  * 所在区域
24
24
  */
25
25
  region: string;
26
+ /**
27
+ * Time zone
28
+ * 时区
29
+ */
30
+ timeZone?: string;
26
31
  };
@@ -43,4 +43,9 @@ export type OrgCreateRQ = {
43
43
  * 所在区域
44
44
  */
45
45
  region: string;
46
+ /**
47
+ * Time zone
48
+ * 时区
49
+ */
50
+ timeZone?: string;
46
51
  };
@@ -38,4 +38,9 @@ export interface OrgUpdateRQ extends UpdateModel {
38
38
  * 查询关键字
39
39
  */
40
40
  queryKeyword?: string;
41
+ /**
42
+ * Time zone
43
+ * 时区
44
+ */
45
+ timeZone?: string;
41
46
  }
@@ -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.60",
3
+ "version": "1.1.62",
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": "^7.29.7",
44
- "@babel/plugin-transform-runtime": "^7.29.7",
45
- "@babel/preset-env": "^7.29.7",
46
- "@babel/runtime-corejs3": "^7.29.7",
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
- ? this.app.get("unitJoin")
157
- : undefined;
168
+ ? this.app.get("unitJoin")
169
+ : undefined;
158
170
  }
159
171
 
160
172
  /**
@@ -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/TimeZoneTiplist";
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
+ }
@@ -44,4 +44,10 @@ export type OrgUpdateReadDto = {
44
44
  * Query Keyword
45
45
  */
46
46
  queryKeyword?: string;
47
+
48
+ /**
49
+ * Time zone
50
+ * 时区
51
+ */
52
+ timeZone?: string;
47
53
  };
@@ -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",
@@ -133,6 +133,7 @@
133
133
  "templateCMSPODATA": "CMS采购数据",
134
134
  "templateCMSSTOCKDATA": "CMS库存数据",
135
135
  "templateKind": "模板类型",
136
+ "timeZone": "时区",
136
137
  "years5": ["1年", "2年", "3年", "4年", "5年"],
137
138
  "uiTypeEmail": "电子邮箱",
138
139
  "uiTypeMobile": "手机号",
@@ -133,6 +133,7 @@
133
133
  "templateCMSPODATA": "CMS採購數據",
134
134
  "templateCMSSTOCKDATA": "CMS庫存數據",
135
135
  "templateKind": "模板類型",
136
+ "timeZone": "時區",
136
137
  "years5": ["1年", "2年", "3年", "4年", "5年"],
137
138
  "uiTypeEmail": "電子郵件",
138
139
  "uiTypeMobile": "手機號碼",
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";
@@ -26,4 +26,10 @@ export type AppBuyNewRQ = {
26
26
  * 所在区域
27
27
  */
28
28
  region: string;
29
+
30
+ /**
31
+ * Time zone
32
+ * 时区
33
+ */
34
+ timeZone?: string;
29
35
  };
@@ -51,4 +51,10 @@ export type OrgCreateRQ = {
51
51
  * 所在区域
52
52
  */
53
53
  region: string;
54
+
55
+ /**
56
+ * Time zone
57
+ * 时区
58
+ */
59
+ timeZone?: string;
54
60
  };
@@ -45,4 +45,10 @@ export interface OrgUpdateRQ extends UpdateModel {
45
45
  * 查询关键字
46
46
  */
47
47
  queryKeyword?: string;
48
+
49
+ /**
50
+ * Time zone
51
+ * 时区
52
+ */
53
+ timeZone?: string;
48
54
  }
@@ -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
+ };