@etsoo/materialui 1.4.78 → 1.4.80

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.
@@ -1,9 +1,4 @@
1
- import {
2
- AddressUtils,
3
- ApiAuthorizationScheme,
4
- Culture,
5
- ExternalSettings
6
- } from "@etsoo/appscript";
1
+ import { AddressUtils, Culture } from "@etsoo/appscript";
7
2
  import { ReactApp } from "../src";
8
3
  import { DataTypes, DomUtils, IActionResult, Utils } from "@etsoo/shared";
9
4
  import React, { act } from "react";
@@ -28,49 +23,49 @@ const supportedCultures: DataTypes.CultureDefinition[] = [
28
23
  // Supported regions
29
24
  const supportedRegions = ["CN"];
30
25
 
31
- const settings = ExternalSettings.format({
32
- /**
33
- * Endpoint of the API service
34
- */
35
- endpoint: "http://{hostname}/com.etsoo.SmartERPApi/api/",
36
-
37
- /**
38
- * App root url
39
- */
40
- homepage: "/cms",
41
-
42
- /**
43
- * Web url of the cloud
44
- */
45
- webUrl: "http://localhost",
46
-
47
- // Authorization scheme
48
- authScheme: ApiAuthorizationScheme.Bearer,
49
-
50
- // Detected culture
51
- detectedCulture,
52
-
53
- // Supported cultures
54
- cultures: supportedCultures,
55
-
56
- // Supported regions
57
- regions: supportedRegions,
58
-
59
- // Browser's time zone
60
- timeZone: Utils.getTimeZone(),
61
-
62
- // Current country or region
63
- currentRegion: AddressUtils.getRegion(
64
- supportedRegions,
65
- detectedCountry,
66
- detectedCulture
67
- ),
68
-
69
- // Current culture
70
- currentCulture: DomUtils.getCulture(supportedCultures, detectedCulture)![0]
71
- });
72
-
73
- const app = new ReactApp(settings, "test");
26
+ const app = new ReactApp(
27
+ {
28
+ appId: 0,
29
+
30
+ /**
31
+ * Endpoint of the API service
32
+ */
33
+ endpoint: "http://{hostname}/com.etsoo.SmartERPApi/api/",
34
+
35
+ /**
36
+ * App root url
37
+ */
38
+ homepage: "/cms",
39
+
40
+ /**
41
+ * Web url of the cloud
42
+ */
43
+ webUrl: "http://localhost",
44
+
45
+ // Detected culture
46
+ detectedCulture,
47
+
48
+ // Supported cultures
49
+ cultures: supportedCultures,
50
+
51
+ // Supported regions
52
+ regions: supportedRegions,
53
+
54
+ // Browser's time zone
55
+ timeZone: Utils.getTimeZone(),
56
+
57
+ // Current country or region
58
+ currentRegion: AddressUtils.getRegion(
59
+ supportedRegions,
60
+ detectedCountry,
61
+ detectedCulture
62
+ ),
63
+
64
+ // Current culture
65
+ currentCulture: DomUtils.getCulture(supportedCultures, detectedCulture)![0]
66
+ },
67
+ "test"
68
+ );
74
69
 
75
70
  // Root
76
71
  const root = document.body;
@@ -85,7 +85,7 @@ class ReactApp extends appscript_1.CoreApp {
85
85
  this.notifier.message(notificationbase_1.NotificationMessageType.Success, this.get("updateTip") + `(${[app, version].join(", ")})`, this.get("updateReady"));
86
86
  });
87
87
  }
88
- this.cultureState = new react_2.CultureState(settings.currentCulture);
88
+ this.cultureState = new react_2.CultureState(this.settings.currentCulture);
89
89
  }
90
90
  /**
91
91
  * Override alert action result
@@ -34,7 +34,7 @@ class ServiceApp extends ReactApp_1.ReactApp {
34
34
  */
35
35
  constructor(settings, name, debug = false) {
36
36
  super(settings, name, debug);
37
- const coreEndpoint = settings.endpoints?.core;
37
+ const coreEndpoint = this.settings.endpoints?.core;
38
38
  if (coreEndpoint == null) {
39
39
  throw new Error("Core API endpont is required.");
40
40
  }
@@ -77,7 +77,7 @@ export class ReactApp extends CoreApp {
77
77
  this.notifier.message(NotificationMessageType.Success, this.get("updateTip") + `(${[app, version].join(", ")})`, this.get("updateReady"));
78
78
  });
79
79
  }
80
- this.cultureState = new CultureState(settings.currentCulture);
80
+ this.cultureState = new CultureState(this.settings.currentCulture);
81
81
  }
82
82
  /**
83
83
  * Override alert action result
@@ -31,7 +31,7 @@ export class ServiceApp extends ReactApp {
31
31
  */
32
32
  constructor(settings, name, debug = false) {
33
33
  super(settings, name, debug);
34
- const coreEndpoint = settings.endpoints?.core;
34
+ const coreEndpoint = this.settings.endpoints?.core;
35
35
  if (coreEndpoint == null) {
36
36
  throw new Error("Core API endpont is required.");
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.4.78",
3
+ "version": "1.4.80",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -40,12 +40,12 @@
40
40
  "@dnd-kit/sortable": "^10.0.0",
41
41
  "@emotion/react": "^11.14.0",
42
42
  "@emotion/styled": "^11.14.0",
43
- "@etsoo/appscript": "^1.5.98",
43
+ "@etsoo/appscript": "^1.6.0",
44
44
  "@etsoo/notificationbase": "^1.1.58",
45
- "@etsoo/react": "^1.8.28",
46
- "@etsoo/shared": "^1.2.60",
47
- "@mui/icons-material": "^6.4.3",
48
- "@mui/material": "^6.4.3",
45
+ "@etsoo/react": "^1.8.29",
46
+ "@etsoo/shared": "^1.2.61",
47
+ "@mui/icons-material": "^6.4.4",
48
+ "@mui/material": "^6.4.4",
49
49
  "@mui/x-data-grid": "^7.26.0",
50
50
  "chart.js": "^4.4.7",
51
51
  "chartjs-plugin-datalabels": "^2.2.0",
@@ -200,7 +200,7 @@ export class ReactApp<S extends IAppSettings, D extends IUser>
200
200
  });
201
201
  }
202
202
 
203
- this.cultureState = new CultureState(settings.currentCulture);
203
+ this.cultureState = new CultureState(this.settings.currentCulture);
204
204
  }
205
205
 
206
206
  /**
@@ -57,7 +57,7 @@ export class ServiceApp<
57
57
  constructor(settings: S, name: string, debug: boolean = false) {
58
58
  super(settings, name, debug);
59
59
 
60
- const coreEndpoint = settings.endpoints?.core;
60
+ const coreEndpoint = this.settings.endpoints?.core;
61
61
  if (coreEndpoint == null) {
62
62
  throw new Error("Core API endpont is required.");
63
63
  }