@etsoo/materialui 1.3.85 → 1.3.87
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/AddresSelector.d.ts +1 -1
- package/lib/HiSelector.d.ts +2 -1
- package/lib/HiSelectorTL.d.ts +2 -1
- package/lib/NotifierMU.js +1 -1
- package/lib/app/CommonApp.js +1 -0
- package/lib/app/IServiceUser.d.ts +2 -2
- package/lib/app/ServiceApp.js +2 -1
- package/lib/texts/DateText.d.ts +2 -2
- package/lib/texts/DateText.js +4 -4
- package/package.json +20 -20
- package/src/AddresSelector.tsx +2 -1
- package/src/HiSelector.tsx +2 -6
- package/src/HiSelectorTL.tsx +2 -2
- package/src/NotifierMU.tsx +1 -1
- package/src/app/CommonApp.ts +1 -0
- package/src/app/IServiceUser.ts +2 -2
- package/src/app/ServiceApp.ts +5 -1
- package/src/texts/DateText.tsx +52 -52
package/lib/AddresSelector.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AddressApi, AddressCity, AddressDistrict, AddressRegionDb, AddressState } from "@etsoo/appscript";
|
|
2
|
-
import { RegularBreakpoints } from "@mui/material";
|
|
3
2
|
import React from "react";
|
|
3
|
+
import { RegularBreakpoints } from "@mui/material/Grid";
|
|
4
4
|
/**
|
|
5
5
|
* Address field
|
|
6
6
|
*/
|
package/lib/HiSelector.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType, LabelDefaultType } from "@etsoo/shared";
|
|
2
|
-
import {
|
|
2
|
+
import { SelectChangeEvent } from "@mui/material";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { RegularBreakpoints } from "@mui/material/Grid";
|
|
4
5
|
/**
|
|
5
6
|
* Hierarchy selector props
|
|
6
7
|
*/
|
package/lib/HiSelectorTL.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType } from "@etsoo/shared";
|
|
2
|
-
import { AutocompleteChangeReason
|
|
2
|
+
import { AutocompleteChangeReason } from "@mui/material";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { RegularBreakpoints } from "@mui/material/Grid";
|
|
4
5
|
/**
|
|
5
6
|
* Hierarchy tiplist selector props
|
|
6
7
|
*/
|
package/lib/NotifierMU.js
CHANGED
|
@@ -175,7 +175,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
175
175
|
event.preventDefault();
|
|
176
176
|
event.currentTarget.elements.namedItem("okButton")?.click();
|
|
177
177
|
return false;
|
|
178
|
-
}, children: [_jsxs(IconDialogTitle, { className: "draggable-dialog-title", children: [_jsx(Info, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { children: [typeof this.content === "string" ? (_jsx(DialogContentText, { children: this.content })) : (this.content), localInputs, _jsx(Typography, { variant: "caption", display: "block", ref: errorRef, color:
|
|
178
|
+
}, children: [_jsxs(IconDialogTitle, { className: "draggable-dialog-title", children: [_jsx(Info, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { children: [typeof this.content === "string" ? (_jsx(DialogContentText, { children: this.content })) : (this.content), localInputs, _jsx(Typography, { variant: "caption", display: "block", ref: errorRef, color: "error" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
|
|
179
179
|
if (this.onReturn)
|
|
180
180
|
this.onReturn(undefined);
|
|
181
181
|
this.dismiss();
|
package/lib/app/CommonApp.js
CHANGED
|
@@ -14,11 +14,11 @@ export interface IServiceUser extends IUser {
|
|
|
14
14
|
*/
|
|
15
15
|
readonly organizationName: string;
|
|
16
16
|
/**
|
|
17
|
-
* Service device id
|
|
17
|
+
* Service (App) device id
|
|
18
18
|
*/
|
|
19
19
|
readonly serviceDeviceId: string;
|
|
20
20
|
/**
|
|
21
|
-
* Service passphrase encrypted
|
|
21
|
+
* Service (App) passphrase encrypted
|
|
22
22
|
*/
|
|
23
23
|
readonly servicePassphrase: string;
|
|
24
24
|
}
|
package/lib/app/ServiceApp.js
CHANGED
|
@@ -101,6 +101,7 @@ export class ServiceApp extends ReactApp {
|
|
|
101
101
|
// Merge additional data passed
|
|
102
102
|
const rq = {
|
|
103
103
|
deviceId: this.deviceId,
|
|
104
|
+
region: this.region,
|
|
104
105
|
timezone: this.getTimeZone(),
|
|
105
106
|
...data
|
|
106
107
|
};
|
|
@@ -262,7 +263,7 @@ export class ServiceApp extends ReactApp {
|
|
|
262
263
|
// Service user
|
|
263
264
|
this.serviceUser = serviceUser;
|
|
264
265
|
// Service API token
|
|
265
|
-
this.serviceApi.authorize(
|
|
266
|
+
this.serviceApi.authorize(serviceUser.tokenScheme ?? "Bearer", serviceUser.token);
|
|
266
267
|
// Keep = true, means service could hold the refresh token for long access
|
|
267
268
|
// Trigger Context change and serviceUser is ready then
|
|
268
269
|
super.userLogin(user, refreshToken, true);
|
package/lib/texts/DateText.d.ts
CHANGED
package/lib/texts/DateText.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DateUtils } from
|
|
3
|
-
import { Typography } from
|
|
2
|
+
import { DateUtils } from "@etsoo/shared";
|
|
3
|
+
import { Typography } from "@mui/material";
|
|
4
4
|
/**
|
|
5
5
|
* Date text
|
|
6
6
|
* @param props Props
|
|
@@ -8,7 +8,7 @@ import { Typography } from '@mui/material';
|
|
|
8
8
|
*/
|
|
9
9
|
export function DateText(props) {
|
|
10
10
|
// Destruct
|
|
11
|
-
const { nearDays, locale =
|
|
11
|
+
const { nearDays, locale = "lookup", options, timeZone, value, ...rest } = props;
|
|
12
12
|
// Format date
|
|
13
13
|
const date = DateUtils.parse(value);
|
|
14
14
|
// Formatted value
|
|
@@ -18,7 +18,7 @@ export function DateText(props) {
|
|
|
18
18
|
if (nearDays != null &&
|
|
19
19
|
date != null &&
|
|
20
20
|
Math.abs(new Date().substract(date).totalDays) <= nearDays) {
|
|
21
|
-
rest.color =
|
|
21
|
+
rest.color = "error";
|
|
22
22
|
}
|
|
23
23
|
// Layout
|
|
24
24
|
return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: localValue }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.87",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -48,16 +48,16 @@
|
|
|
48
48
|
"@dnd-kit/core": "^6.1.0",
|
|
49
49
|
"@dnd-kit/sortable": "^8.0.0",
|
|
50
50
|
"@emotion/css": "^11.13.0",
|
|
51
|
-
"@emotion/react": "^11.13.
|
|
51
|
+
"@emotion/react": "^11.13.3",
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|
|
53
|
-
"@etsoo/appscript": "^1.5.
|
|
53
|
+
"@etsoo/appscript": "^1.5.15",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.47",
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
55
|
+
"@etsoo/react": "^1.7.66",
|
|
56
56
|
"@etsoo/shared": "^1.2.44",
|
|
57
|
-
"@mui/icons-material": "^
|
|
58
|
-
"@mui/material": "^
|
|
59
|
-
"@mui/x-data-grid": "^7.
|
|
60
|
-
"chart.js": "^4.4.
|
|
57
|
+
"@mui/icons-material": "^6.1.1",
|
|
58
|
+
"@mui/material": "^6.1.1",
|
|
59
|
+
"@mui/x-data-grid": "^7.18.0",
|
|
60
|
+
"chart.js": "^4.4.4",
|
|
61
61
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
62
62
|
"eventemitter3": "^5.0.1",
|
|
63
63
|
"pica": "^9.0.1",
|
|
@@ -70,27 +70,27 @@
|
|
|
70
70
|
"react-imask": "7.6.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@babel/cli": "^7.
|
|
73
|
+
"@babel/cli": "^7.25.6",
|
|
74
74
|
"@babel/core": "^7.25.2",
|
|
75
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
76
|
-
"@babel/preset-env": "^7.25.
|
|
75
|
+
"@babel/plugin-transform-runtime": "^7.25.4",
|
|
76
|
+
"@babel/preset-env": "^7.25.4",
|
|
77
77
|
"@babel/preset-react": "^7.24.7",
|
|
78
78
|
"@babel/preset-typescript": "^7.24.7",
|
|
79
|
-
"@babel/runtime-corejs3": "^7.25.
|
|
80
|
-
"@testing-library/jest-dom": "^6.
|
|
81
|
-
"@testing-library/react": "^16.0.
|
|
82
|
-
"@types/jest": "^29.5.
|
|
79
|
+
"@babel/runtime-corejs3": "^7.25.6",
|
|
80
|
+
"@testing-library/jest-dom": "^6.5.0",
|
|
81
|
+
"@testing-library/react": "^16.0.1",
|
|
82
|
+
"@types/jest": "^29.5.13",
|
|
83
83
|
"@types/pica": "^9.0.4",
|
|
84
84
|
"@types/pulltorefreshjs": "^0.1.7",
|
|
85
|
-
"@types/react": "^18.3.
|
|
86
|
-
"@types/react-avatar-editor": "^13.0.
|
|
85
|
+
"@types/react": "^18.3.8",
|
|
86
|
+
"@types/react-avatar-editor": "^13.0.3",
|
|
87
87
|
"@types/react-dom": "^18.3.0",
|
|
88
88
|
"@types/react-input-mask": "^3.0.5",
|
|
89
89
|
"@types/react-window": "^1.8.8",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
91
|
-
"@typescript-eslint/parser": "^8.
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^8.6.0",
|
|
91
|
+
"@typescript-eslint/parser": "^8.6.0",
|
|
92
92
|
"jest": "^29.7.0",
|
|
93
93
|
"jest-environment-jsdom": "^29.7.0",
|
|
94
|
-
"typescript": "^5.
|
|
94
|
+
"typescript": "^5.6.2"
|
|
95
95
|
}
|
|
96
96
|
}
|
package/src/AddresSelector.tsx
CHANGED
|
@@ -5,11 +5,12 @@ import {
|
|
|
5
5
|
AddressRegionDb,
|
|
6
6
|
AddressState
|
|
7
7
|
} from "@etsoo/appscript";
|
|
8
|
-
import { FormLabel, Grid
|
|
8
|
+
import { FormLabel, Grid } from "@mui/material";
|
|
9
9
|
import React from "react";
|
|
10
10
|
import { globalApp } from "./app/ReactApp";
|
|
11
11
|
import { ComboBox } from "./ComboBox";
|
|
12
12
|
import { Tiplist } from "./Tiplist";
|
|
13
|
+
import { RegularBreakpoints } from "@mui/material/Grid";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Address field
|
package/src/HiSelector.tsx
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType, LabelDefaultType } from "@etsoo/shared";
|
|
2
|
-
import {
|
|
3
|
-
FormLabel,
|
|
4
|
-
Grid,
|
|
5
|
-
RegularBreakpoints,
|
|
6
|
-
SelectChangeEvent
|
|
7
|
-
} from "@mui/material";
|
|
2
|
+
import { FormLabel, Grid, SelectChangeEvent } from "@mui/material";
|
|
8
3
|
import React from "react";
|
|
9
4
|
import { SelectEx } from "./SelectEx";
|
|
5
|
+
import { RegularBreakpoints } from "@mui/material/Grid";
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* Hierarchy selector props
|
package/src/HiSelectorTL.tsx
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
AutocompleteChangeReason,
|
|
4
4
|
AutocompleteValue,
|
|
5
5
|
FormLabel,
|
|
6
|
-
Grid
|
|
7
|
-
RegularBreakpoints
|
|
6
|
+
Grid
|
|
8
7
|
} from "@mui/material";
|
|
9
8
|
import React from "react";
|
|
10
9
|
import { Tiplist } from "./Tiplist";
|
|
10
|
+
import { RegularBreakpoints } from "@mui/material/Grid";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Hierarchy tiplist selector props
|
package/src/NotifierMU.tsx
CHANGED
package/src/app/CommonApp.ts
CHANGED
package/src/app/IServiceUser.ts
CHANGED
|
@@ -17,12 +17,12 @@ export interface IServiceUser extends IUser {
|
|
|
17
17
|
readonly organizationName: string;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Service device id
|
|
20
|
+
* Service (App) device id
|
|
21
21
|
*/
|
|
22
22
|
readonly serviceDeviceId: string;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Service passphrase encrypted
|
|
25
|
+
* Service (App) passphrase encrypted
|
|
26
26
|
*/
|
|
27
27
|
readonly servicePassphrase: string;
|
|
28
28
|
}
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -160,6 +160,7 @@ export class ServiceApp<
|
|
|
160
160
|
// Merge additional data passed
|
|
161
161
|
const rq: RefreshTokenRQ = {
|
|
162
162
|
deviceId: this.deviceId,
|
|
163
|
+
region: this.region,
|
|
163
164
|
timezone: this.getTimeZone(),
|
|
164
165
|
...data
|
|
165
166
|
};
|
|
@@ -373,7 +374,10 @@ export class ServiceApp<
|
|
|
373
374
|
this.serviceUser = serviceUser;
|
|
374
375
|
|
|
375
376
|
// Service API token
|
|
376
|
-
this.serviceApi.authorize(
|
|
377
|
+
this.serviceApi.authorize(
|
|
378
|
+
serviceUser.tokenScheme ?? "Bearer",
|
|
379
|
+
serviceUser.token
|
|
380
|
+
);
|
|
377
381
|
|
|
378
382
|
// Keep = true, means service could hold the refresh token for long access
|
|
379
383
|
// Trigger Context change and serviceUser is ready then
|
package/src/texts/DateText.tsx
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { DateUtils } from
|
|
2
|
-
import { Typography, TypographyProps } from
|
|
3
|
-
import React from
|
|
1
|
+
import { DateUtils } from "@etsoo/shared";
|
|
2
|
+
import { Typography, TypographyProps } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Date text props
|
|
7
7
|
*/
|
|
8
8
|
export interface DateTextProps extends TypographyProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Locale
|
|
11
|
+
*/
|
|
12
|
+
locale?: string;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Near days to show in error color
|
|
16
|
+
*/
|
|
17
|
+
nearDays?: number;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Options
|
|
21
|
+
*/
|
|
22
|
+
options?: DateUtils.FormatOptions;
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Time zone
|
|
26
|
+
*/
|
|
27
|
+
timeZone?: string;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Value to display
|
|
31
|
+
*/
|
|
32
|
+
value?: Date | string;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -38,37 +38,37 @@ export interface DateTextProps extends TypographyProps {
|
|
|
38
38
|
* @returns Component
|
|
39
39
|
*/
|
|
40
40
|
export function DateText(props: DateTextProps) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
// Destruct
|
|
42
|
+
const {
|
|
43
|
+
nearDays,
|
|
44
|
+
locale = "lookup",
|
|
45
|
+
options,
|
|
46
|
+
timeZone,
|
|
47
|
+
value,
|
|
48
|
+
...rest
|
|
49
|
+
} = props;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// Format date
|
|
52
|
+
const date = DateUtils.parse(value);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
// Formatted value
|
|
55
|
+
const localValue =
|
|
56
|
+
date == null
|
|
57
|
+
? undefined
|
|
58
|
+
: DateUtils.format(value, locale, options, timeZone);
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
if (
|
|
61
|
+
nearDays != null &&
|
|
62
|
+
date != null &&
|
|
63
|
+
Math.abs(new Date().substract(date).totalDays) <= nearDays
|
|
64
|
+
) {
|
|
65
|
+
rest.color = "error";
|
|
66
|
+
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
// Layout
|
|
69
|
+
return (
|
|
70
|
+
<Typography component="span" fontSize="inherit" {...rest}>
|
|
71
|
+
{localValue}
|
|
72
|
+
</Typography>
|
|
73
|
+
);
|
|
74
74
|
}
|