@etsoo/materialui 1.4.81 → 1.4.83

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.
@@ -154,6 +154,7 @@ function SearchBar(props) {
154
154
  }
155
155
  else {
156
156
  const childD = child.getBoundingClientRect();
157
+ console.log("SearchBar", child.querySelector("input")?.name, childD.width, childD.height, child.clientWidth, child.computedStyleMap().get("width"));
157
158
  childWidth = childD.width + itemGap;
158
159
  child.setAttribute(cachedWidthName, childWidth.toString());
159
160
  }
@@ -19,6 +19,11 @@ export interface IServiceApp extends ReactAppType {
19
19
  * @param tryLogin Try login or not
20
20
  */
21
21
  loadCore(tryLogin?: boolean): void;
22
+ /**
23
+ * Load URL with core origin
24
+ * @param url URL
25
+ */
26
+ loadUrlEx(url: string): void;
22
27
  /**
23
28
  * Switch organization
24
29
  * @param organizationId Organization ID
@@ -41,6 +41,11 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
41
41
  * @param data Login parameters
42
42
  */
43
43
  toLoginPage(data?: AppLoginParams): void;
44
+ /**
45
+ * Load URL with core origin
46
+ * @param url URL
47
+ */
48
+ loadUrlEx(url: string): void;
44
49
  /**
45
50
  * Signout, with userLogout and toLoginPage
46
51
  * @param action Callback
@@ -71,34 +71,25 @@ class ServiceApp extends ReactApp_1.ReactApp {
71
71
  // Cache current URL
72
72
  this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
73
73
  // Get the redirect URL
74
- new appscript_1.AuthApi(this)
75
- .getLogInUrl({
76
- region: this.region,
77
- device: this.deviceId
78
- })
79
- .then((url) => {
74
+ new appscript_1.AuthApi(this).getLogInUrl().then((url) => {
80
75
  if (!url)
81
76
  return;
82
77
  // Add try login flag
83
78
  if (params != null) {
84
79
  url = url.addUrlParams(params);
85
80
  }
86
- // Is it embeded?
87
- if (this.embedded) {
88
- globalThis.parent.postMessage(["login", url], this.coreOrigin);
89
- }
90
- else {
91
- if (appscript_1.BridgeUtils.host == null) {
92
- globalThis.location.href = url;
93
- }
94
- else {
95
- appscript_1.BridgeUtils.host.loadApp(this.coreName, url);
96
- }
97
- }
81
+ this.loadUrlEx(url);
98
82
  });
99
83
  // Make sure apply new device id for new login
100
84
  this.clearDeviceId();
101
85
  }
86
+ /**
87
+ * Load URL with core origin
88
+ * @param url URL
89
+ */
90
+ loadUrlEx(url) {
91
+ super.loadUrl(url, this.coreOrigin);
92
+ }
102
93
  /**
103
94
  * Signout, with userLogout and toLoginPage
104
95
  * @param action Callback
@@ -148,6 +148,7 @@ export function SearchBar(props) {
148
148
  }
149
149
  else {
150
150
  const childD = child.getBoundingClientRect();
151
+ console.log("SearchBar", child.querySelector("input")?.name, childD.width, childD.height, child.clientWidth, child.computedStyleMap().get("width"));
151
152
  childWidth = childD.width + itemGap;
152
153
  child.setAttribute(cachedWidthName, childWidth.toString());
153
154
  }
@@ -19,6 +19,11 @@ export interface IServiceApp extends ReactAppType {
19
19
  * @param tryLogin Try login or not
20
20
  */
21
21
  loadCore(tryLogin?: boolean): void;
22
+ /**
23
+ * Load URL with core origin
24
+ * @param url URL
25
+ */
26
+ loadUrlEx(url: string): void;
22
27
  /**
23
28
  * Switch organization
24
29
  * @param organizationId Organization ID
@@ -41,6 +41,11 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
41
41
  * @param data Login parameters
42
42
  */
43
43
  toLoginPage(data?: AppLoginParams): void;
44
+ /**
45
+ * Load URL with core origin
46
+ * @param url URL
47
+ */
48
+ loadUrlEx(url: string): void;
44
49
  /**
45
50
  * Signout, with userLogout and toLoginPage
46
51
  * @param action Callback
@@ -68,34 +68,25 @@ export class ServiceApp extends ReactApp {
68
68
  // Cache current URL
69
69
  this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
70
70
  // Get the redirect URL
71
- new AuthApi(this)
72
- .getLogInUrl({
73
- region: this.region,
74
- device: this.deviceId
75
- })
76
- .then((url) => {
71
+ new AuthApi(this).getLogInUrl().then((url) => {
77
72
  if (!url)
78
73
  return;
79
74
  // Add try login flag
80
75
  if (params != null) {
81
76
  url = url.addUrlParams(params);
82
77
  }
83
- // Is it embeded?
84
- if (this.embedded) {
85
- globalThis.parent.postMessage(["login", url], this.coreOrigin);
86
- }
87
- else {
88
- if (BridgeUtils.host == null) {
89
- globalThis.location.href = url;
90
- }
91
- else {
92
- BridgeUtils.host.loadApp(this.coreName, url);
93
- }
94
- }
78
+ this.loadUrlEx(url);
95
79
  });
96
80
  // Make sure apply new device id for new login
97
81
  this.clearDeviceId();
98
82
  }
83
+ /**
84
+ * Load URL with core origin
85
+ * @param url URL
86
+ */
87
+ loadUrlEx(url) {
88
+ super.loadUrl(url, this.coreOrigin);
89
+ }
99
90
  /**
100
91
  * Signout, with userLogout and toLoginPage
101
92
  * @param action Callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.4.81",
3
+ "version": "1.4.83",
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.2",
43
+ "@etsoo/appscript": "^1.6.9",
44
44
  "@etsoo/notificationbase": "^1.1.58",
45
- "@etsoo/react": "^1.8.30",
45
+ "@etsoo/react": "^1.8.31",
46
46
  "@etsoo/shared": "^1.2.61",
47
- "@mui/icons-material": "^6.4.4",
47
+ "@mui/icons-material": "^6.4.5",
48
48
  "@mui/material": "^6.4.4",
49
- "@mui/x-data-grid": "^7.26.0",
50
- "chart.js": "^4.4.7",
49
+ "@mui/x-data-grid": "^7.27.0",
50
+ "chart.js": "^4.4.8",
51
51
  "chartjs-plugin-datalabels": "^2.2.0",
52
52
  "eventemitter3": "^5.0.1",
53
53
  "pica": "^9.0.1",
@@ -83,6 +83,6 @@
83
83
  "@vitejs/plugin-react": "^4.3.4",
84
84
  "jsdom": "^26.0.0",
85
85
  "typescript": "^5.7.3",
86
- "vitest": "^3.0.5"
86
+ "vitest": "^3.0.6"
87
87
  }
88
88
  }
package/src/SearchBar.tsx CHANGED
@@ -228,6 +228,16 @@ export function SearchBar(props: SearchBarProps) {
228
228
  childWidth = Number.parseFloat(cachedWidth);
229
229
  } else {
230
230
  const childD = child.getBoundingClientRect();
231
+
232
+ console.log(
233
+ "SearchBar",
234
+ child.querySelector("input")?.name,
235
+ childD.width,
236
+ childD.height,
237
+ child.clientWidth,
238
+ child.computedStyleMap().get("width")
239
+ );
240
+
231
241
  childWidth = childD.width + itemGap;
232
242
  child.setAttribute(cachedWidthName, childWidth.toString());
233
243
  }
@@ -23,6 +23,12 @@ export interface IServiceApp extends ReactAppType {
23
23
  */
24
24
  loadCore(tryLogin?: boolean): void;
25
25
 
26
+ /**
27
+ * Load URL with core origin
28
+ * @param url URL
29
+ */
30
+ loadUrlEx(url: string): void;
31
+
26
32
  /**
27
33
  * Switch organization
28
34
  * @param organizationId Organization ID
@@ -97,35 +97,29 @@ export class ServiceApp<
97
97
  this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
98
98
 
99
99
  // Get the redirect URL
100
- new AuthApi(this)
101
- .getLogInUrl({
102
- region: this.region,
103
- device: this.deviceId
104
- })
105
- .then((url) => {
106
- if (!url) return;
107
-
108
- // Add try login flag
109
- if (params != null) {
110
- url = url.addUrlParams(params);
111
- }
112
-
113
- // Is it embeded?
114
- if (this.embedded) {
115
- globalThis.parent.postMessage(["login", url], this.coreOrigin);
116
- } else {
117
- if (BridgeUtils.host == null) {
118
- globalThis.location.href = url;
119
- } else {
120
- BridgeUtils.host.loadApp(this.coreName, url);
121
- }
122
- }
123
- });
100
+ new AuthApi(this).getLogInUrl().then((url) => {
101
+ if (!url) return;
102
+
103
+ // Add try login flag
104
+ if (params != null) {
105
+ url = url.addUrlParams(params);
106
+ }
107
+
108
+ this.loadUrlEx(url);
109
+ });
124
110
 
125
111
  // Make sure apply new device id for new login
126
112
  this.clearDeviceId();
127
113
  }
128
114
 
115
+ /**
116
+ * Load URL with core origin
117
+ * @param url URL
118
+ */
119
+ loadUrlEx(url: string) {
120
+ super.loadUrl(url, this.coreOrigin);
121
+ }
122
+
129
123
  /**
130
124
  * Signout, with userLogout and toLoginPage
131
125
  * @param action Callback