@etsoo/materialui 1.4.87 → 1.4.89
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.
- package/lib/cjs/DataGridRenderers.js +5 -0
- package/lib/cjs/InputField.js +5 -1
- package/lib/cjs/SearchField.js +7 -3
- package/lib/cjs/app/ISmartERPUser.d.ts +2 -2
- package/lib/mjs/DataGridRenderers.js +5 -0
- package/lib/mjs/InputField.js +5 -1
- package/lib/mjs/SearchField.js +7 -3
- package/lib/mjs/app/ISmartERPUser.d.ts +2 -2
- package/package.json +2 -2
- package/src/DataGridRenderers.tsx +4 -0
- package/src/InputField.tsx +6 -1
- package/src/SearchField.tsx +8 -3
- package/src/app/ISmartERPUser.ts +4 -2
|
@@ -37,6 +37,11 @@ var DataGridRenderers;
|
|
|
37
37
|
const value = formattedValue ?? data[field];
|
|
38
38
|
if (value == null)
|
|
39
39
|
return undefined;
|
|
40
|
+
// For unknow and string type, keep the simple format
|
|
41
|
+
if (type === react_1.GridDataType.Unkwown)
|
|
42
|
+
return value;
|
|
43
|
+
else if (type === react_1.GridDataType.String)
|
|
44
|
+
return new String(value);
|
|
40
45
|
// For date time
|
|
41
46
|
// Conversion if necessary
|
|
42
47
|
if (type === react_1.GridDataType.Date || type === react_1.GridDataType.DateTime) {
|
package/lib/cjs/InputField.js
CHANGED
|
@@ -37,8 +37,12 @@ exports.InputField = react_2.default.forwardRef((props, ref) => {
|
|
|
37
37
|
const onChangeEx = (event) => {
|
|
38
38
|
// Min characters check
|
|
39
39
|
const len = event.target.value.length;
|
|
40
|
-
if (len > 0 && len < minChars)
|
|
40
|
+
if (len > 0 && len < minChars) {
|
|
41
|
+
// Avoid to trigger the form change event
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
event.preventDefault();
|
|
41
44
|
return;
|
|
45
|
+
}
|
|
42
46
|
if (onChange && (delayed == null || onChangeDelay != null))
|
|
43
47
|
onChange(event);
|
|
44
48
|
delayed?.call(undefined, event);
|
package/lib/cjs/SearchField.js
CHANGED
|
@@ -29,11 +29,15 @@ function SearchField(props) {
|
|
|
29
29
|
? (0, react_1.useDelayedExecutor)(onChange, changeDelay)
|
|
30
30
|
: undefined;
|
|
31
31
|
const onChangeEx = (event) => {
|
|
32
|
-
if (onChange == null)
|
|
33
|
-
return;
|
|
34
32
|
// Min characters check
|
|
35
33
|
const len = event.target.value.length;
|
|
36
|
-
if (len > 0 && len < minChars)
|
|
34
|
+
if (len > 0 && len < minChars) {
|
|
35
|
+
// Avoid to trigger the form change event
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (onChange == null)
|
|
37
41
|
return;
|
|
38
42
|
if (changeDelay == null || changeDelay < 1) {
|
|
39
43
|
onChange(event);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUser } from "@etsoo/appscript";
|
|
1
|
+
import { IUser, LoginInputAuthResult } from "@etsoo/appscript";
|
|
2
2
|
import { IActionResult } from "@etsoo/shared";
|
|
3
3
|
/**
|
|
4
4
|
* SmartERP user interface
|
|
@@ -18,4 +18,4 @@ export interface ISmartERPUser extends IUser {
|
|
|
18
18
|
/**
|
|
19
19
|
* SmartERP user login result
|
|
20
20
|
*/
|
|
21
|
-
export type SmartERPLoginResult = IActionResult<ISmartERPUser>;
|
|
21
|
+
export type SmartERPLoginResult = IActionResult<ISmartERPUser | LoginInputAuthResult>;
|
|
@@ -31,6 +31,11 @@ export var DataGridRenderers;
|
|
|
31
31
|
const value = formattedValue ?? data[field];
|
|
32
32
|
if (value == null)
|
|
33
33
|
return undefined;
|
|
34
|
+
// For unknow and string type, keep the simple format
|
|
35
|
+
if (type === GridDataType.Unkwown)
|
|
36
|
+
return value;
|
|
37
|
+
else if (type === GridDataType.String)
|
|
38
|
+
return new String(value);
|
|
34
39
|
// For date time
|
|
35
40
|
// Conversion if necessary
|
|
36
41
|
if (type === GridDataType.Date || type === GridDataType.DateTime) {
|
package/lib/mjs/InputField.js
CHANGED
|
@@ -31,8 +31,12 @@ export const InputField = React.forwardRef((props, ref) => {
|
|
|
31
31
|
const onChangeEx = (event) => {
|
|
32
32
|
// Min characters check
|
|
33
33
|
const len = event.target.value.length;
|
|
34
|
-
if (len > 0 && len < minChars)
|
|
34
|
+
if (len > 0 && len < minChars) {
|
|
35
|
+
// Avoid to trigger the form change event
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
event.preventDefault();
|
|
35
38
|
return;
|
|
39
|
+
}
|
|
36
40
|
if (onChange && (delayed == null || onChangeDelay != null))
|
|
37
41
|
onChange(event);
|
|
38
42
|
delayed?.call(undefined, event);
|
package/lib/mjs/SearchField.js
CHANGED
|
@@ -23,11 +23,15 @@ export function SearchField(props) {
|
|
|
23
23
|
? useDelayedExecutor(onChange, changeDelay)
|
|
24
24
|
: undefined;
|
|
25
25
|
const onChangeEx = (event) => {
|
|
26
|
-
if (onChange == null)
|
|
27
|
-
return;
|
|
28
26
|
// Min characters check
|
|
29
27
|
const len = event.target.value.length;
|
|
30
|
-
if (len > 0 && len < minChars)
|
|
28
|
+
if (len > 0 && len < minChars) {
|
|
29
|
+
// Avoid to trigger the form change event
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (onChange == null)
|
|
31
35
|
return;
|
|
32
36
|
if (changeDelay == null || changeDelay < 1) {
|
|
33
37
|
onChange(event);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUser } from "@etsoo/appscript";
|
|
1
|
+
import { IUser, LoginInputAuthResult } from "@etsoo/appscript";
|
|
2
2
|
import { IActionResult } from "@etsoo/shared";
|
|
3
3
|
/**
|
|
4
4
|
* SmartERP user interface
|
|
@@ -18,4 +18,4 @@ export interface ISmartERPUser extends IUser {
|
|
|
18
18
|
/**
|
|
19
19
|
* SmartERP user login result
|
|
20
20
|
*/
|
|
21
|
-
export type SmartERPLoginResult = IActionResult<ISmartERPUser>;
|
|
21
|
+
export type SmartERPLoginResult = IActionResult<ISmartERPUser | LoginInputAuthResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.89",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
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.
|
|
43
|
+
"@etsoo/appscript": "^1.6.12",
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.58",
|
|
45
45
|
"@etsoo/react": "^1.8.31",
|
|
46
46
|
"@etsoo/shared": "^1.2.61",
|
|
@@ -41,6 +41,10 @@ export namespace DataGridRenderers {
|
|
|
41
41
|
const value = formattedValue ?? data[field!];
|
|
42
42
|
if (value == null) return undefined;
|
|
43
43
|
|
|
44
|
+
// For unknow and string type, keep the simple format
|
|
45
|
+
if (type === GridDataType.Unkwown) return value;
|
|
46
|
+
else if (type === GridDataType.String) return new String(value);
|
|
47
|
+
|
|
44
48
|
// For date time
|
|
45
49
|
// Conversion if necessary
|
|
46
50
|
if (type === GridDataType.Date || type === GridDataType.DateTime) {
|
package/src/InputField.tsx
CHANGED
|
@@ -77,7 +77,12 @@ export const InputField = React.forwardRef<HTMLDivElement, InputFieldProps>(
|
|
|
77
77
|
) => {
|
|
78
78
|
// Min characters check
|
|
79
79
|
const len = event.target.value.length;
|
|
80
|
-
if (len > 0 && len < minChars)
|
|
80
|
+
if (len > 0 && len < minChars) {
|
|
81
|
+
// Avoid to trigger the form change event
|
|
82
|
+
event.stopPropagation();
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
81
86
|
|
|
82
87
|
if (onChange && (delayed == null || onChangeDelay != null))
|
|
83
88
|
onChange(event);
|
package/src/SearchField.tsx
CHANGED
|
@@ -61,11 +61,16 @@ export function SearchField(props: SearchFieldProps) {
|
|
|
61
61
|
const onChangeEx = (
|
|
62
62
|
event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
|
|
63
63
|
) => {
|
|
64
|
-
if (onChange == null) return;
|
|
65
|
-
|
|
66
64
|
// Min characters check
|
|
67
65
|
const len = event.target.value.length;
|
|
68
|
-
if (len > 0 && len < minChars)
|
|
66
|
+
if (len > 0 && len < minChars) {
|
|
67
|
+
// Avoid to trigger the form change event
|
|
68
|
+
event.stopPropagation();
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (onChange == null) return;
|
|
69
74
|
|
|
70
75
|
if (changeDelay == null || changeDelay < 1) {
|
|
71
76
|
onChange(event);
|
package/src/app/ISmartERPUser.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUser } from "@etsoo/appscript";
|
|
1
|
+
import { IUser, LoginInputAuthResult } from "@etsoo/appscript";
|
|
2
2
|
import { IActionResult } from "@etsoo/shared";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -21,4 +21,6 @@ export interface ISmartERPUser extends IUser {
|
|
|
21
21
|
/**
|
|
22
22
|
* SmartERP user login result
|
|
23
23
|
*/
|
|
24
|
-
export type SmartERPLoginResult = IActionResult<
|
|
24
|
+
export type SmartERPLoginResult = IActionResult<
|
|
25
|
+
ISmartERPUser | LoginInputAuthResult
|
|
26
|
+
>;
|