@etsoo/smarterp-core 1.0.53 → 1.0.55

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.
@@ -9,4 +9,5 @@ export * from "./org/OrgSwitchPopover";
9
9
  export * from "./org/OrgTiplist";
10
10
  export * from "./public/ButtonCultures";
11
11
  export * from "./public/ButtonCurrencies";
12
+ export * from "./public/CultureList";
12
13
  export * from "./user/UserTiplist";
@@ -29,5 +29,6 @@ __exportStar(require("./org/OrgTiplist"), exports);
29
29
  // public
30
30
  __exportStar(require("./public/ButtonCultures"), exports);
31
31
  __exportStar(require("./public/ButtonCurrencies"), exports);
32
+ __exportStar(require("./public/CultureList"), exports);
32
33
  // user
33
34
  __exportStar(require("./user/UserTiplist"), exports);
@@ -0,0 +1,8 @@
1
+ import { SelectExProps } from "@etsoo/materialui";
2
+ import { ListType1 } from "@etsoo/shared";
3
+ /**
4
+ * Supported cultures list component
5
+ * @param props Props
6
+ * @returns Component
7
+ */
8
+ export declare function CultureList(props: Omit<SelectExProps<ListType1>, "options">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CultureList = CultureList;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const materialui_1 = require("@etsoo/materialui");
6
+ const ICoreServiceApp_1 = require("../../ICoreServiceApp");
7
+ /**
8
+ * Supported cultures list component
9
+ * @param props Props
10
+ * @returns Component
11
+ */
12
+ function CultureList(props) {
13
+ // App
14
+ const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
15
+ // Destruct
16
+ const { label = app.get("culture"), name = "culture", ...rest } = props;
17
+ // Layout
18
+ return ((0, jsx_runtime_1.jsx)(materialui_1.SelectEx, { label: label, name: name, options: app.settings.cultures.map((c) => ({
19
+ id: c.name,
20
+ label: c.label
21
+ })), ...rest }));
22
+ }
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "Collapse navigation menu",
19
19
  "companyNo": "Company No.",
20
20
  "currentOrg": "Current organization",
21
+ "customResources": "Custom resources",
21
22
  "darkMode": "Dark mode",
22
23
  "days": "Days",
23
24
  "directReports": "Direct reports",
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "折叠导航菜单",
19
19
  "companyNo": "机构编号",
20
20
  "currentOrg": "当前机构",
21
+ "customResources": "自定义资源",
21
22
  "darkMode": "深色模式",
22
23
  "days": "天数",
23
24
  "directReports": "直接下属",
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "折疊導航菜單",
19
19
  "companyNo": "機構編號",
20
20
  "currentOrg": "當前機構",
21
+ "customResources": "自定義資源",
21
22
  "darkMode": "深色模式",
22
23
  "days": "天數",
23
24
  "directReports": "直接下屬",
@@ -1,4 +1,11 @@
1
1
  import { OrgResourceItem } from "../../dto/org/OrgResourceItem";
2
+ type OrgResourceItemUpdate = OrgResourceItem & {
3
+ /**
4
+ * Updated flag
5
+ * 更新标记
6
+ */
7
+ updatedFlag: number;
8
+ };
2
9
  /**
3
10
  * Create resource request data
4
11
  * 创建资源请求数据
@@ -23,5 +30,6 @@ export type OrgCreateResourceRQ = {
23
30
  * Resource items
24
31
  * 资源项
25
32
  */
26
- items?: OrgResourceItem[];
33
+ items?: OrgResourceItemUpdate[];
27
34
  };
35
+ export {};
@@ -9,4 +9,5 @@ export * from "./org/OrgSwitchPopover";
9
9
  export * from "./org/OrgTiplist";
10
10
  export * from "./public/ButtonCultures";
11
11
  export * from "./public/ButtonCurrencies";
12
+ export * from "./public/CultureList";
12
13
  export * from "./user/UserTiplist";
@@ -13,5 +13,6 @@ export * from "./org/OrgTiplist";
13
13
  // public
14
14
  export * from "./public/ButtonCultures";
15
15
  export * from "./public/ButtonCurrencies";
16
+ export * from "./public/CultureList";
16
17
  // user
17
18
  export * from "./user/UserTiplist";
@@ -0,0 +1,8 @@
1
+ import { SelectExProps } from "@etsoo/materialui";
2
+ import { ListType1 } from "@etsoo/shared";
3
+ /**
4
+ * Supported cultures list component
5
+ * @param props Props
6
+ * @returns Component
7
+ */
8
+ export declare function CultureList(props: Omit<SelectExProps<ListType1>, "options">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SelectEx } from "@etsoo/materialui";
3
+ import { useRequiredAppContext } from "../../ICoreServiceApp";
4
+ /**
5
+ * Supported cultures list component
6
+ * @param props Props
7
+ * @returns Component
8
+ */
9
+ export function CultureList(props) {
10
+ // App
11
+ const app = useRequiredAppContext();
12
+ // Destruct
13
+ const { label = app.get("culture"), name = "culture", ...rest } = props;
14
+ // Layout
15
+ return (_jsx(SelectEx, { label: label, name: name, options: app.settings.cultures.map((c) => ({
16
+ id: c.name,
17
+ label: c.label
18
+ })), ...rest }));
19
+ }
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "Collapse navigation menu",
19
19
  "companyNo": "Company No.",
20
20
  "currentOrg": "Current organization",
21
+ "customResources": "Custom resources",
21
22
  "darkMode": "Dark mode",
22
23
  "days": "Days",
23
24
  "directReports": "Direct reports",
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "折叠导航菜单",
19
19
  "companyNo": "机构编号",
20
20
  "currentOrg": "当前机构",
21
+ "customResources": "自定义资源",
21
22
  "darkMode": "深色模式",
22
23
  "days": "天数",
23
24
  "directReports": "直接下属",
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "折疊導航菜單",
19
19
  "companyNo": "機構編號",
20
20
  "currentOrg": "當前機構",
21
+ "customResources": "自定義資源",
21
22
  "darkMode": "深色模式",
22
23
  "days": "天數",
23
24
  "directReports": "直接下屬",
@@ -1,4 +1,11 @@
1
1
  import { OrgResourceItem } from "../../dto/org/OrgResourceItem";
2
+ type OrgResourceItemUpdate = OrgResourceItem & {
3
+ /**
4
+ * Updated flag
5
+ * 更新标记
6
+ */
7
+ updatedFlag: number;
8
+ };
2
9
  /**
3
10
  * Create resource request data
4
11
  * 创建资源请求数据
@@ -23,5 +30,6 @@ export type OrgCreateResourceRQ = {
23
30
  * Resource items
24
31
  * 资源项
25
32
  */
26
- items?: OrgResourceItem[];
33
+ items?: OrgResourceItemUpdate[];
27
34
  };
35
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -53,8 +53,8 @@
53
53
  "vitest": "^3.1.2"
54
54
  },
55
55
  "dependencies": {
56
- "@etsoo/appscript": "^1.6.31",
57
- "@etsoo/materialui": "^1.5.37",
56
+ "@etsoo/appscript": "^1.6.32",
57
+ "@etsoo/materialui": "^1.5.38",
58
58
  "@etsoo/react": "^1.8.40",
59
59
  "@etsoo/shared": "^1.2.70",
60
60
  "@etsoo/toolpad": "^1.0.26",
@@ -16,6 +16,7 @@ export * from "./org/OrgTiplist";
16
16
  // public
17
17
  export * from "./public/ButtonCultures";
18
18
  export * from "./public/ButtonCurrencies";
19
+ export * from "./public/CultureList";
19
20
 
20
21
  // user
21
22
  export * from "./user/UserTiplist";
@@ -0,0 +1,29 @@
1
+ import { SelectEx, SelectExProps } from "@etsoo/materialui";
2
+ import { useRequiredAppContext } from "../../ICoreServiceApp";
3
+ import { ListType1 } from "@etsoo/shared";
4
+
5
+ /**
6
+ * Supported cultures list component
7
+ * @param props Props
8
+ * @returns Component
9
+ */
10
+ export function CultureList(props: Omit<SelectExProps<ListType1>, "options">) {
11
+ // App
12
+ const app = useRequiredAppContext();
13
+
14
+ // Destruct
15
+ const { label = app.get("culture"), name = "culture", ...rest } = props;
16
+
17
+ // Layout
18
+ return (
19
+ <SelectEx
20
+ label={label}
21
+ name={name}
22
+ options={app.settings.cultures.map((c) => ({
23
+ id: c.name,
24
+ label: c.label
25
+ }))}
26
+ {...rest}
27
+ />
28
+ );
29
+ }
package/src/i18n/en.json CHANGED
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "Collapse navigation menu",
19
19
  "companyNo": "Company No.",
20
20
  "currentOrg": "Current organization",
21
+ "customResources": "Custom resources",
21
22
  "darkMode": "Dark mode",
22
23
  "days": "Days",
23
24
  "directReports": "Direct reports",
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "折叠导航菜单",
19
19
  "companyNo": "机构编号",
20
20
  "currentOrg": "当前机构",
21
+ "customResources": "自定义资源",
21
22
  "darkMode": "深色模式",
22
23
  "days": "天数",
23
24
  "directReports": "直接下属",
@@ -18,6 +18,7 @@
18
18
  "collapseNavMenuAriaLabel": "折疊導航菜單",
19
19
  "companyNo": "機構編號",
20
20
  "currentOrg": "當前機構",
21
+ "customResources": "自定義資源",
21
22
  "darkMode": "深色模式",
22
23
  "days": "天數",
23
24
  "directReports": "直接下屬",
@@ -1,5 +1,13 @@
1
1
  import { OrgResourceItem } from "../../dto/org/OrgResourceItem";
2
2
 
3
+ type OrgResourceItemUpdate = OrgResourceItem & {
4
+ /**
5
+ * Updated flag
6
+ * 更新标记
7
+ */
8
+ updatedFlag: number;
9
+ };
10
+
3
11
  /**
4
12
  * Create resource request data
5
13
  * 创建资源请求数据
@@ -27,5 +35,5 @@ export type OrgCreateResourceRQ = {
27
35
  * Resource items
28
36
  * 资源项
29
37
  */
30
- items?: OrgResourceItem[];
38
+ items?: OrgResourceItemUpdate[];
31
39
  };