@etsoo/materialui 1.5.30 → 1.5.31

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.
@@ -72,10 +72,10 @@ const root = document.body;
72
72
  const container: HTMLElement = document.createElement("div");
73
73
  root.append(container);
74
74
 
75
- // The state provider
76
- const Provider = ReactApp.notifierProvider;
77
-
78
75
  act(() => {
76
+ // The state provider
77
+ const Provider = ReactApp.notifierProvider;
78
+
79
79
  // Concorrent renderer needs act block
80
80
  const reactRoot = createRoot(container);
81
81
  reactRoot.render(<Provider />);
@@ -1,5 +1,5 @@
1
- import { GridRowId, GridValidRowModel } from "@mui/x-data-grid/models/gridRows";
2
- import { DataGridProps } from "@mui/x-data-grid/models/props/DataGridProps";
1
+ import { GridRowId, GridValidRowModel } from "@mui/x-data-grid/models";
2
+ import { DataGridProps } from "@mui/x-data-grid/internals";
3
3
  /**
4
4
  * Data table selected cell params
5
5
  */
@@ -7,7 +7,7 @@ exports.DataTable = DataTable;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const ReactApp_1 = require("./app/ReactApp");
10
- const DataGrid_1 = require("@mui/x-data-grid/DataGrid/DataGrid");
10
+ const DataGrid_1 = require("@mui/x-data-grid/DataGrid");
11
11
  /**
12
12
  * Data table
13
13
  * @param props Props
@@ -1,6 +1,6 @@
1
1
  import { QueryRQ } from "@etsoo/appscript";
2
2
  import { IdType } from "@etsoo/shared";
3
- import { GridApiCommunity } from "@mui/x-data-grid/models/api/gridApiCommunity";
3
+ import { GridApiCommunity } from "@mui/x-data-grid/internals";
4
4
  /**
5
5
  * MU utilities
6
6
  */
@@ -1,4 +1,4 @@
1
- import { ApiRefreshTokenDto, IApi, IApiPayload } from "@etsoo/appscript";
1
+ import { ApiRefreshTokenDto, IApi, IApiPayload, TokenAuthRQ } from "@etsoo/appscript";
2
2
  import { ReactAppType } from "./ReactApp";
3
3
  import { IServiceUser, ServiceUserToken } from "./IServiceUser";
4
4
  import { IActionResult } from "@etsoo/shared";
@@ -14,6 +14,12 @@ export interface IServiceApp extends ReactAppType {
14
14
  * Core system origin
15
15
  */
16
16
  readonly coreOrigin: string;
17
+ /**
18
+ * Get token authorization request data
19
+ * @param api API, if not provided, use the core API
20
+ * @returns Result
21
+ */
22
+ getTokenAuthRQ(api?: IApi): TokenAuthRQ;
17
23
  /**
18
24
  * Load core system UI
19
25
  * @param tryLogin Try login or not
@@ -1,4 +1,4 @@
1
- import { ApiRefreshTokenDto, AppLoginParams, AppTryLoginParams, ExternalEndpoint, IApi, IApiPayload } from "@etsoo/appscript";
1
+ import { ApiRefreshTokenDto, AppLoginParams, AppTryLoginParams, ExternalEndpoint, IApi, IApiPayload, TokenAuthRQ } from "@etsoo/appscript";
2
2
  import { IServiceApp } from "./IServiceApp";
3
3
  import { IServiceAppSettings } from "./IServiceAppSettings";
4
4
  import { IServiceUser, ServiceUserToken } from "./IServiceUser";
@@ -31,6 +31,12 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
31
31
  * @param debug Debug mode
32
32
  */
33
33
  constructor(settings: S, name: string, debug?: boolean);
34
+ /**
35
+ * Get token authorization request data
36
+ * @param api API, if not provided, use the core API
37
+ * @returns Result
38
+ */
39
+ getTokenAuthRQ(api?: IApi): TokenAuthRQ;
34
40
  /**
35
41
  * Load core system UI
36
42
  * @param tryLogin Try login or not
@@ -43,6 +43,19 @@ class ServiceApp extends ReactApp_1.ReactApp {
43
43
  this.coreApi = this.createApi(this.coreName, coreEndpoint);
44
44
  this.keepLogin = true;
45
45
  }
46
+ /**
47
+ * Get token authorization request data
48
+ * @param api API, if not provided, use the core API
49
+ * @returns Result
50
+ */
51
+ getTokenAuthRQ(api) {
52
+ api ??= this.coreApi;
53
+ const auth = api.getAuthorization();
54
+ if (auth == null) {
55
+ throw new Error("Authorization is required.");
56
+ }
57
+ return { accessToken: auth.token, tokenScheme: auth.scheme };
58
+ }
46
59
  /**
47
60
  * Load core system UI
48
61
  * @param tryLogin Try login or not
@@ -1,5 +1,5 @@
1
- import { GridRowId, GridValidRowModel } from "@mui/x-data-grid/models/gridRows";
2
- import { DataGridProps } from "@mui/x-data-grid/models/props/DataGridProps";
1
+ import { GridRowId, GridValidRowModel } from "@mui/x-data-grid/models";
2
+ import { DataGridProps } from "@mui/x-data-grid/internals";
3
3
  /**
4
4
  * Data table selected cell params
5
5
  */
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { useAppContext } from "./app/ReactApp";
4
- import { DataGrid } from "@mui/x-data-grid/DataGrid/DataGrid";
4
+ import { DataGrid } from "@mui/x-data-grid/DataGrid";
5
5
  /**
6
6
  * Data table
7
7
  * @param props Props
@@ -1,6 +1,6 @@
1
1
  import { QueryRQ } from "@etsoo/appscript";
2
2
  import { IdType } from "@etsoo/shared";
3
- import { GridApiCommunity } from "@mui/x-data-grid/models/api/gridApiCommunity";
3
+ import { GridApiCommunity } from "@mui/x-data-grid/internals";
4
4
  /**
5
5
  * MU utilities
6
6
  */
@@ -1,4 +1,4 @@
1
- import { ApiRefreshTokenDto, IApi, IApiPayload } from "@etsoo/appscript";
1
+ import { ApiRefreshTokenDto, IApi, IApiPayload, TokenAuthRQ } from "@etsoo/appscript";
2
2
  import { ReactAppType } from "./ReactApp";
3
3
  import { IServiceUser, ServiceUserToken } from "./IServiceUser";
4
4
  import { IActionResult } from "@etsoo/shared";
@@ -14,6 +14,12 @@ export interface IServiceApp extends ReactAppType {
14
14
  * Core system origin
15
15
  */
16
16
  readonly coreOrigin: string;
17
+ /**
18
+ * Get token authorization request data
19
+ * @param api API, if not provided, use the core API
20
+ * @returns Result
21
+ */
22
+ getTokenAuthRQ(api?: IApi): TokenAuthRQ;
17
23
  /**
18
24
  * Load core system UI
19
25
  * @param tryLogin Try login or not
@@ -1,4 +1,4 @@
1
- import { ApiRefreshTokenDto, AppLoginParams, AppTryLoginParams, ExternalEndpoint, IApi, IApiPayload } from "@etsoo/appscript";
1
+ import { ApiRefreshTokenDto, AppLoginParams, AppTryLoginParams, ExternalEndpoint, IApi, IApiPayload, TokenAuthRQ } from "@etsoo/appscript";
2
2
  import { IServiceApp } from "./IServiceApp";
3
3
  import { IServiceAppSettings } from "./IServiceAppSettings";
4
4
  import { IServiceUser, ServiceUserToken } from "./IServiceUser";
@@ -31,6 +31,12 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
31
31
  * @param debug Debug mode
32
32
  */
33
33
  constructor(settings: S, name: string, debug?: boolean);
34
+ /**
35
+ * Get token authorization request data
36
+ * @param api API, if not provided, use the core API
37
+ * @returns Result
38
+ */
39
+ getTokenAuthRQ(api?: IApi): TokenAuthRQ;
34
40
  /**
35
41
  * Load core system UI
36
42
  * @param tryLogin Try login or not
@@ -40,6 +40,19 @@ export class ServiceApp extends ReactApp {
40
40
  this.coreApi = this.createApi(this.coreName, coreEndpoint);
41
41
  this.keepLogin = true;
42
42
  }
43
+ /**
44
+ * Get token authorization request data
45
+ * @param api API, if not provided, use the core API
46
+ * @returns Result
47
+ */
48
+ getTokenAuthRQ(api) {
49
+ api ??= this.coreApi;
50
+ const auth = api.getAuthorization();
51
+ if (auth == null) {
52
+ throw new Error("Authorization is required.");
53
+ }
54
+ return { accessToken: auth.token, tokenScheme: auth.scheme };
55
+ }
43
56
  /**
44
57
  * Load core system UI
45
58
  * @param tryLogin Try login or not
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.5.30",
3
+ "version": "1.5.31",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -40,14 +40,14 @@
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.6.22",
43
+ "@etsoo/appscript": "^1.6.25",
44
44
  "@etsoo/notificationbase": "^1.1.60",
45
- "@etsoo/react": "^1.8.39",
46
- "@etsoo/shared": "^1.2.68",
45
+ "@etsoo/react": "^1.8.40",
46
+ "@etsoo/shared": "^1.2.69",
47
47
  "@mui/icons-material": "^7.0.2",
48
48
  "@mui/material": "^7.0.2",
49
- "@mui/x-data-grid": "^7.28.3",
50
- "chart.js": "^4.4.8",
49
+ "@mui/x-data-grid": "^8.0.0",
50
+ "chart.js": "^4.4.9",
51
51
  "chartjs-plugin-datalabels": "^2.2.0",
52
52
  "dompurify": "^3.2.5",
53
53
  "eventemitter3": "^5.0.1",
@@ -81,7 +81,7 @@
81
81
  "@types/react-dom": "^18.3.6",
82
82
  "@types/react-input-mask": "^3.0.6",
83
83
  "@types/react-window": "^1.8.8",
84
- "@vitejs/plugin-react": "^4.3.4",
84
+ "@vitejs/plugin-react": "^4.4.0",
85
85
  "jsdom": "^26.1.0",
86
86
  "typescript": "^5.8.3",
87
87
  "vitest": "^3.1.1"
@@ -2,7 +2,7 @@ import { DataTable, DataTableProps } from "./DataTable";
2
2
  import React from "react";
3
3
  import { ListType1 } from "@etsoo/shared";
4
4
  import { useAppContext } from "./app/ReactApp";
5
- import { GridRenderCellParams } from "@mui/x-data-grid/models/params/gridCellParams";
5
+ import { GridRenderCellParams } from "@mui/x-data-grid/models/params";
6
6
 
7
7
  /**
8
8
  * Culture table props
package/src/DataTable.tsx CHANGED
@@ -1,9 +1,12 @@
1
1
  import React from "react";
2
2
  import { useAppContext } from "./app/ReactApp";
3
- import { GridRowId, GridValidRowModel } from "@mui/x-data-grid/models/gridRows";
4
- import { DataGridProps } from "@mui/x-data-grid/models/props/DataGridProps";
5
- import { GridCellModesModel } from "@mui/x-data-grid/models/api/gridEditingApi";
6
- import { DataGrid } from "@mui/x-data-grid/DataGrid/DataGrid";
3
+ import {
4
+ GridCellModesModel,
5
+ GridRowId,
6
+ GridValidRowModel
7
+ } from "@mui/x-data-grid/models";
8
+ import { DataGridProps } from "@mui/x-data-grid/internals";
9
+ import { DataGrid } from "@mui/x-data-grid/DataGrid";
7
10
 
8
11
  /**
9
12
  * Data table selected cell params
package/src/MUUtils.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { QueryRQ } from "@etsoo/appscript";
2
2
  import { IdType } from "@etsoo/shared";
3
- import { GridApiCommunity } from "@mui/x-data-grid/models/api/gridApiCommunity";
3
+ import { GridApiCommunity } from "@mui/x-data-grid/internals";
4
4
 
5
5
  /**
6
6
  * MU utilities
@@ -1,4 +1,9 @@
1
- import { ApiRefreshTokenDto, IApi, IApiPayload } from "@etsoo/appscript";
1
+ import {
2
+ ApiRefreshTokenDto,
3
+ IApi,
4
+ IApiPayload,
5
+ TokenAuthRQ
6
+ } from "@etsoo/appscript";
2
7
  import { ReactAppType } from "./ReactApp";
3
8
  import { IServiceUser, ServiceUserToken } from "./IServiceUser";
4
9
  import { IActionResult } from "@etsoo/shared";
@@ -17,6 +22,13 @@ export interface IServiceApp extends ReactAppType {
17
22
  */
18
23
  readonly coreOrigin: string;
19
24
 
25
+ /**
26
+ * Get token authorization request data
27
+ * @param api API, if not provided, use the core API
28
+ * @returns Result
29
+ */
30
+ getTokenAuthRQ(api?: IApi): TokenAuthRQ;
31
+
20
32
  /**
21
33
  * Load core system UI
22
34
  * @param tryLogin Try login or not
@@ -6,7 +6,8 @@ import {
6
6
  BridgeUtils,
7
7
  ExternalEndpoint,
8
8
  IApi,
9
- IApiPayload
9
+ IApiPayload,
10
+ TokenAuthRQ
10
11
  } from "@etsoo/appscript";
11
12
  import { IServiceApp } from "./IServiceApp";
12
13
  import { IServiceAppSettings } from "./IServiceAppSettings";
@@ -68,6 +69,23 @@ export class ServiceApp<
68
69
  this.keepLogin = true;
69
70
  }
70
71
 
72
+ /**
73
+ * Get token authorization request data
74
+ * @param api API, if not provided, use the core API
75
+ * @returns Result
76
+ */
77
+ getTokenAuthRQ(api?: IApi): TokenAuthRQ {
78
+ api ??= this.coreApi;
79
+
80
+ const auth = api.getAuthorization();
81
+
82
+ if (auth == null) {
83
+ throw new Error("Authorization is required.");
84
+ }
85
+
86
+ return { accessToken: auth.token, tokenScheme: auth.scheme };
87
+ }
88
+
71
89
  /**
72
90
  * Load core system UI
73
91
  * @param tryLogin Try login or not
package/vite.config.mts CHANGED
@@ -4,6 +4,11 @@ import react from "@vitejs/plugin-react";
4
4
  export default defineConfig({
5
5
  plugins: [react()],
6
6
  test: {
7
+ server: {
8
+ deps: {
9
+ inline: [/@mui\/x-data-grid.*/]
10
+ }
11
+ },
7
12
  globals: true,
8
13
  environment: "jsdom",
9
14
  include: ["__tests__/**/*.ts(x)?"]