@etsoo/materialui 1.0.98 → 1.1.0
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/__tests__/ComboBox.tsx +1 -1
- package/__tests__/SelectEx.tsx +0 -1
- package/babel.config.json +5 -1
- package/lib/DataSteps.js +5 -4
- package/lib/NotifierMU.d.ts +1 -1
- package/lib/OptionGroup.js +1 -1
- package/lib/app/ReactApp.d.ts +1 -1
- package/package.json +18 -18
- package/src/DataSteps.tsx +7 -3
- package/src/NotifierMU.tsx +6 -6
- package/src/OptionGroup.tsx +1 -1
package/__tests__/ComboBox.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComboBox } from '../src';
|
|
3
3
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
4
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
//import '@testing-library/jest-dom/extend-expect';
|
|
5
5
|
|
|
6
6
|
it('Render ComboBox', async () => {
|
|
7
7
|
// Arrange
|
package/__tests__/SelectEx.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectEx } from '../src';
|
|
3
3
|
import { findByText, fireEvent, render, screen } from '@testing-library/react';
|
|
4
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
5
4
|
import { ListType1, Utils } from '@etsoo/shared';
|
|
6
5
|
import { act } from 'react-dom/test-utils';
|
|
7
6
|
|
package/babel.config.json
CHANGED
package/lib/DataSteps.js
CHANGED
|
@@ -5,9 +5,9 @@ import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore';
|
|
|
5
5
|
import CheckIcon from '@mui/icons-material/Check';
|
|
6
6
|
import StartIcon from '@mui/icons-material/Start';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import { HBox } from './FlexBox';
|
|
8
9
|
import { globalApp } from './app/ReactApp';
|
|
9
10
|
import { MUGlobal } from './MUGlobal';
|
|
10
|
-
import { HBox } from './FlexBox';
|
|
11
11
|
/**
|
|
12
12
|
* Data collecting steps component
|
|
13
13
|
* @param props Props
|
|
@@ -27,7 +27,8 @@ export function DataSteps(props) {
|
|
|
27
27
|
const indexRef = React.useRef(-1);
|
|
28
28
|
// Current Json data
|
|
29
29
|
const jsonRef = React.useRef(jsonValue);
|
|
30
|
-
|
|
30
|
+
// Ignore empty value case
|
|
31
|
+
if (jsonValue !== jsonRef.current && valueFormatter(jsonValue))
|
|
31
32
|
jsonRef.current = jsonValue;
|
|
32
33
|
// Current value
|
|
33
34
|
const [localValue, setLocalValue] = React.useState(value);
|
|
@@ -72,8 +73,8 @@ export function DataSteps(props) {
|
|
|
72
73
|
};
|
|
73
74
|
React.useEffect(() => {
|
|
74
75
|
setLocalValue(valueFormatter(jsonRef.current));
|
|
75
|
-
}, [
|
|
76
|
-
return (React.createElement(TextField, { InputLabelProps: InputLabelProps, inputProps: { style: { cursor: 'pointer' } }, InputProps: {
|
|
76
|
+
}, [valueFormatter]);
|
|
77
|
+
return (React.createElement(TextField, { autoComplete: "new-password", InputLabelProps: InputLabelProps, inputProps: { style: { cursor: 'pointer' } }, InputProps: {
|
|
77
78
|
onKeyDown: (event) => {
|
|
78
79
|
if (event.key === 'Tab')
|
|
79
80
|
return;
|
package/lib/NotifierMU.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class NotificationMU extends NotificationReact {
|
|
|
17
17
|
* @param className Style class name
|
|
18
18
|
* @param classes Style classes
|
|
19
19
|
*/
|
|
20
|
-
render(props: NotificationRenderProps, className
|
|
20
|
+
render(props: NotificationRenderProps, className?: string): JSX.Element;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Antd notifier
|
package/lib/OptionGroup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataTypes, Utils } from '@etsoo/shared';
|
|
2
2
|
import { Box, Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, InputLabel, Radio, RadioGroup, useTheme } from '@mui/material';
|
|
3
|
-
import NotchedOutline from '@mui/material/OutlinedInput
|
|
3
|
+
import NotchedOutline from '@mui/material/OutlinedInput';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
/**
|
|
6
6
|
* OptionGroup
|
package/lib/app/ReactApp.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
|
|
|
98
98
|
/**
|
|
99
99
|
* Get notifier provider
|
|
100
100
|
*/
|
|
101
|
-
static get notifierProvider(): React.FunctionComponent<
|
|
101
|
+
static get notifierProvider(): React.FunctionComponent<DataTypes.StringRecord>;
|
|
102
102
|
private static createNotifier;
|
|
103
103
|
/**
|
|
104
104
|
* Culture state
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,11 +18,10 @@
|
|
|
18
18
|
],
|
|
19
19
|
"testEnvironment": "jsdom",
|
|
20
20
|
"transform": {
|
|
21
|
-
"
|
|
22
|
-
".+\\.tsx?$": "ts-jest"
|
|
21
|
+
"^.+\\.[t|j]sx?$": "babel-jest"
|
|
23
22
|
},
|
|
24
23
|
"transformIgnorePatterns": [
|
|
25
|
-
"/node_modules/(
|
|
24
|
+
"/node_modules/(?!(@etsoo)/)"
|
|
26
25
|
]
|
|
27
26
|
},
|
|
28
27
|
"repository": {
|
|
@@ -46,17 +45,17 @@
|
|
|
46
45
|
},
|
|
47
46
|
"homepage": "https://github.com/ETSOO/ReactMU#readme",
|
|
48
47
|
"dependencies": {
|
|
49
|
-
"@dnd-kit/core": "^6.0.
|
|
48
|
+
"@dnd-kit/core": "^6.0.6",
|
|
50
49
|
"@dnd-kit/sortable": "^7.0.1",
|
|
51
50
|
"@emotion/css": "^11.10.5",
|
|
52
51
|
"@emotion/react": "^11.10.5",
|
|
53
52
|
"@emotion/styled": "^11.10.5",
|
|
54
|
-
"@etsoo/appscript": "^1.3.
|
|
55
|
-
"@etsoo/notificationbase": "^1.1.
|
|
56
|
-
"@etsoo/react": "^1.6.
|
|
57
|
-
"@etsoo/shared": "^1.1.
|
|
58
|
-
"@mui/icons-material": "^5.
|
|
59
|
-
"@mui/material": "^5.
|
|
53
|
+
"@etsoo/appscript": "^1.3.49",
|
|
54
|
+
"@etsoo/notificationbase": "^1.1.20",
|
|
55
|
+
"@etsoo/react": "^1.6.36",
|
|
56
|
+
"@etsoo/shared": "^1.1.84",
|
|
57
|
+
"@mui/icons-material": "^5.11.0",
|
|
58
|
+
"@mui/material": "^5.11.1",
|
|
60
59
|
"@types/pica": "^9.0.1",
|
|
61
60
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
62
61
|
"@types/react": "^18.0.26",
|
|
@@ -71,27 +70,28 @@
|
|
|
71
70
|
"react-dom": "^18.2.0",
|
|
72
71
|
"react-draggable": "^4.4.5",
|
|
73
72
|
"react-imask": "^6.4.3",
|
|
74
|
-
"react-router-dom": "^6.
|
|
73
|
+
"react-router-dom": "^6.6.0",
|
|
75
74
|
"react-window": "^1.8.8"
|
|
76
75
|
},
|
|
77
76
|
"devDependencies": {
|
|
78
77
|
"@babel/cli": "^7.19.3",
|
|
79
78
|
"@babel/core": "^7.20.5",
|
|
80
79
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
80
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
81
81
|
"@babel/preset-env": "^7.20.2",
|
|
82
|
+
"@babel/preset-react": "^7.18.6",
|
|
82
83
|
"@babel/runtime-corejs3": "^7.20.6",
|
|
83
84
|
"@testing-library/jest-dom": "^5.16.5",
|
|
84
85
|
"@testing-library/react": "^13.4.0",
|
|
85
|
-
"@types/jest": "^29.2.
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
87
|
-
"@typescript-eslint/parser": "^5.
|
|
88
|
-
"eslint": "^8.
|
|
86
|
+
"@types/jest": "^29.2.4",
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
88
|
+
"@typescript-eslint/parser": "^5.47.0",
|
|
89
|
+
"eslint": "^8.30.0",
|
|
89
90
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
90
91
|
"eslint-plugin-import": "^2.26.0",
|
|
91
92
|
"eslint-plugin-react": "^7.31.11",
|
|
92
93
|
"jest": "^29.3.1",
|
|
93
94
|
"jest-environment-jsdom": "^29.3.1",
|
|
94
|
-
"
|
|
95
|
-
"typescript": "^4.9.3"
|
|
95
|
+
"typescript": "^4.9.4"
|
|
96
96
|
}
|
|
97
97
|
}
|
package/src/DataSteps.tsx
CHANGED
|
@@ -12,9 +12,9 @@ import CheckIcon from '@mui/icons-material/Check';
|
|
|
12
12
|
import StartIcon from '@mui/icons-material/Start';
|
|
13
13
|
import { InputDialogProps } from '@etsoo/react';
|
|
14
14
|
import React from 'react';
|
|
15
|
+
import { HBox } from './FlexBox';
|
|
15
16
|
import { globalApp } from './app/ReactApp';
|
|
16
17
|
import { MUGlobal } from './MUGlobal';
|
|
17
|
-
import { HBox } from './FlexBox';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Data step
|
|
@@ -85,7 +85,10 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
|
|
|
85
85
|
|
|
86
86
|
// Current Json data
|
|
87
87
|
const jsonRef = React.useRef<T>(jsonValue);
|
|
88
|
-
|
|
88
|
+
|
|
89
|
+
// Ignore empty value case
|
|
90
|
+
if (jsonValue !== jsonRef.current && valueFormatter(jsonValue))
|
|
91
|
+
jsonRef.current = jsonValue;
|
|
89
92
|
|
|
90
93
|
// Current value
|
|
91
94
|
const [localValue, setLocalValue] = React.useState(value);
|
|
@@ -174,10 +177,11 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
|
|
|
174
177
|
|
|
175
178
|
React.useEffect(() => {
|
|
176
179
|
setLocalValue(valueFormatter(jsonRef.current));
|
|
177
|
-
}, [
|
|
180
|
+
}, [valueFormatter]);
|
|
178
181
|
|
|
179
182
|
return (
|
|
180
183
|
<TextField
|
|
184
|
+
autoComplete="new-password"
|
|
181
185
|
InputLabelProps={InputLabelProps}
|
|
182
186
|
inputProps={{ style: { cursor: 'pointer' } }}
|
|
183
187
|
InputProps={{
|
package/src/NotifierMU.tsx
CHANGED
|
@@ -59,7 +59,7 @@ const IconDialogTitle = styled(DialogTitle)`
|
|
|
59
59
|
*/
|
|
60
60
|
export class NotificationMU extends NotificationReact {
|
|
61
61
|
// Create alert
|
|
62
|
-
private createAlert(_props: NotificationRenderProps, className
|
|
62
|
+
private createAlert(_props: NotificationRenderProps, className?: string) {
|
|
63
63
|
const labels = Labels.NotificationMU;
|
|
64
64
|
|
|
65
65
|
const {
|
|
@@ -140,7 +140,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// Create confirm
|
|
143
|
-
private createConfirm(_props: NotificationRenderProps, className
|
|
143
|
+
private createConfirm(_props: NotificationRenderProps, className?: string) {
|
|
144
144
|
const labels = Labels.NotificationMU;
|
|
145
145
|
const title = this.title ?? labels.confirmTitle;
|
|
146
146
|
|
|
@@ -222,7 +222,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
// Create message
|
|
225
|
-
private createMessage(_props: NotificationRenderProps, className
|
|
225
|
+
private createMessage(_props: NotificationRenderProps, className?: string) {
|
|
226
226
|
if (!this.open) return <React.Fragment key={this.id}></React.Fragment>;
|
|
227
227
|
|
|
228
228
|
const setupProps: AlertProps = {
|
|
@@ -248,7 +248,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// Create prompt
|
|
251
|
-
private createPrompt(_props: NotificationRenderProps, className
|
|
251
|
+
private createPrompt(_props: NotificationRenderProps, className?: string) {
|
|
252
252
|
const labels = Labels.NotificationMU;
|
|
253
253
|
const title = this.title ?? labels.promptTitle;
|
|
254
254
|
|
|
@@ -431,7 +431,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
// Create loading
|
|
434
|
-
private createLoading(_props: NotificationRenderProps, className
|
|
434
|
+
private createLoading(_props: NotificationRenderProps, className?: string) {
|
|
435
435
|
// Properties
|
|
436
436
|
const setupProps: CircularProgressProps = { color: 'primary' };
|
|
437
437
|
|
|
@@ -487,7 +487,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
487
487
|
* @param className Style class name
|
|
488
488
|
* @param classes Style classes
|
|
489
489
|
*/
|
|
490
|
-
render(props: NotificationRenderProps, className
|
|
490
|
+
render(props: NotificationRenderProps, className?: string) {
|
|
491
491
|
// Loading bar
|
|
492
492
|
if (this.type === NotificationType.Loading) {
|
|
493
493
|
return this.createLoading(props, className);
|
package/src/OptionGroup.tsx
CHANGED