@etsoo/smarterp-core 1.0.75 → 1.0.77

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.
@@ -98,7 +98,7 @@ class CoreApp {
98
98
  * @returns Label
99
99
  */
100
100
  getIdentifierTypeLabel(type) {
101
- const key = shared_1.DataTypes.getEnumKey(appscript_1.UserIdentifierType, type);
101
+ const key = shared_1.DataTypes.getEnumKey(appscript_1.UserIdentifierType, type) ?? `${type}`;
102
102
  return this.app.get(`uiType${key}`) ?? key;
103
103
  }
104
104
  /**
@@ -1,4 +1,11 @@
1
1
  /**
2
2
  * Core utilities
3
3
  */
4
- export declare namespace CoreUtils { }
4
+ export declare namespace CoreUtils {
5
+ /**
6
+ * Get avatar styles
7
+ * @param isOrg Is this an organization avatar?
8
+ * @returns Styles
9
+ */
10
+ function avatarStyles(isOrg?: boolean): React.CSSProperties;
11
+ }
@@ -1,2 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoreUtils = void 0;
4
+ /**
5
+ * Core utilities
6
+ */
7
+ var CoreUtils;
8
+ (function (CoreUtils) {
9
+ /**
10
+ * Get avatar styles
11
+ * @param isOrg Is this an organization avatar?
12
+ * @returns Styles
13
+ */
14
+ function avatarStyles(isOrg = false) {
15
+ return {
16
+ width: "160px",
17
+ height: isOrg ? "80px" : "160px",
18
+ border: "1px solid #666"
19
+ };
20
+ }
21
+ CoreUtils.avatarStyles = avatarStyles;
22
+ })(CoreUtils || (exports.CoreUtils = CoreUtils = {}));
@@ -95,7 +95,7 @@ export class CoreApp {
95
95
  * @returns Label
96
96
  */
97
97
  getIdentifierTypeLabel(type) {
98
- const key = DataTypes.getEnumKey(UserIdentifierType, type);
98
+ const key = DataTypes.getEnumKey(UserIdentifierType, type) ?? `${type}`;
99
99
  return this.app.get(`uiType${key}`) ?? key;
100
100
  }
101
101
  /**
@@ -1,4 +1,11 @@
1
1
  /**
2
2
  * Core utilities
3
3
  */
4
- export declare namespace CoreUtils { }
4
+ export declare namespace CoreUtils {
5
+ /**
6
+ * Get avatar styles
7
+ * @param isOrg Is this an organization avatar?
8
+ * @returns Styles
9
+ */
10
+ function avatarStyles(isOrg?: boolean): React.CSSProperties;
11
+ }
@@ -1 +1,19 @@
1
- export {};
1
+ /**
2
+ * Core utilities
3
+ */
4
+ export var CoreUtils;
5
+ (function (CoreUtils) {
6
+ /**
7
+ * Get avatar styles
8
+ * @param isOrg Is this an organization avatar?
9
+ * @returns Styles
10
+ */
11
+ function avatarStyles(isOrg = false) {
12
+ return {
13
+ width: "160px",
14
+ height: isOrg ? "80px" : "160px",
15
+ border: "1px solid #666"
16
+ };
17
+ }
18
+ CoreUtils.avatarStyles = avatarStyles;
19
+ })(CoreUtils || (CoreUtils = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -47,16 +47,16 @@
47
47
  "@babel/runtime-corejs3": "^7.27.6",
48
48
  "@types/react": "^18.3.23",
49
49
  "@types/react-dom": "^18.3.7",
50
- "@vitejs/plugin-react": "^4.5.1",
50
+ "@vitejs/plugin-react": "^4.5.2",
51
51
  "jsdom": "^26.1.0",
52
52
  "typescript": "^5.8.3",
53
- "vitest": "^3.2.2"
53
+ "vitest": "^3.2.3"
54
54
  },
55
55
  "dependencies": {
56
- "@etsoo/appscript": "^1.6.38",
57
- "@etsoo/materialui": "^1.5.61",
58
- "@etsoo/react": "^1.8.48",
59
- "@etsoo/shared": "^1.2.74",
56
+ "@etsoo/appscript": "^1.6.39",
57
+ "@etsoo/materialui": "^1.5.62",
58
+ "@etsoo/react": "^1.8.49",
59
+ "@etsoo/shared": "^1.2.75",
60
60
  "@etsoo/toolpad": "^1.0.39",
61
61
  "@mui/material": "^7.1.1",
62
62
  "react": "^18.3.1",
package/src/CoreApp.ts CHANGED
@@ -208,7 +208,7 @@ export class CoreApp implements ICoreApp {
208
208
  * @returns Label
209
209
  */
210
210
  getIdentifierTypeLabel(type: UserIdentifierType) {
211
- const key = DataTypes.getEnumKey(UserIdentifierType, type);
211
+ const key = DataTypes.getEnumKey(UserIdentifierType, type) ?? `${type}`;
212
212
  return this.app.get(`uiType${key}`) ?? key;
213
213
  }
214
214
 
package/src/CoreUtils.ts CHANGED
@@ -1,4 +1,17 @@
1
1
  /**
2
2
  * Core utilities
3
3
  */
4
- export namespace CoreUtils {}
4
+ export namespace CoreUtils {
5
+ /**
6
+ * Get avatar styles
7
+ * @param isOrg Is this an organization avatar?
8
+ * @returns Styles
9
+ */
10
+ export function avatarStyles(isOrg: boolean = false): React.CSSProperties {
11
+ return {
12
+ width: "160px",
13
+ height: isOrg ? "80px" : "160px",
14
+ border: "1px solid #666"
15
+ };
16
+ }
17
+ }