@etsoo/materialui 1.1.34 → 1.1.36
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/ComboBox.js +4 -10
- package/package.json +9 -9
- package/src/ComboBox.tsx +5 -10
package/lib/ComboBox.js
CHANGED
|
@@ -60,9 +60,10 @@ export function ComboBox(props) {
|
|
|
60
60
|
// null for controlled
|
|
61
61
|
const [stateValue, setStateValue] = React.useState(null);
|
|
62
62
|
React.useEffect(() => {
|
|
63
|
-
if (localValue != null)
|
|
63
|
+
if (localValue != null && localValue != stateValue) {
|
|
64
64
|
setStateValue(localValue);
|
|
65
|
-
|
|
65
|
+
}
|
|
66
|
+
}, [localValue]);
|
|
66
67
|
// Add readOnly
|
|
67
68
|
const addReadOnly = (params) => {
|
|
68
69
|
if (readOnly != null) {
|
|
@@ -117,14 +118,7 @@ export function ComboBox(props) {
|
|
|
117
118
|
}
|
|
118
119
|
setOptions(result);
|
|
119
120
|
});
|
|
120
|
-
}, [
|
|
121
|
-
propertyWay,
|
|
122
|
-
loadData,
|
|
123
|
-
onLoadData,
|
|
124
|
-
autoAddBlankItem,
|
|
125
|
-
idField,
|
|
126
|
-
labelField
|
|
127
|
-
]);
|
|
121
|
+
}, [propertyWay, autoAddBlankItem, idField, labelField]);
|
|
128
122
|
React.useEffect(() => {
|
|
129
123
|
return () => {
|
|
130
124
|
isMounted.current = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.36",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
"@emotion/css": "^11.10.5",
|
|
51
51
|
"@emotion/react": "^11.10.5",
|
|
52
52
|
"@emotion/styled": "^11.10.5",
|
|
53
|
-
"@etsoo/appscript": "^1.3.
|
|
53
|
+
"@etsoo/appscript": "^1.3.65",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.23",
|
|
55
55
|
"@etsoo/react": "^1.6.47",
|
|
56
56
|
"@etsoo/shared": "^1.1.88",
|
|
57
|
-
"@mui/icons-material": "^5.11.
|
|
58
|
-
"@mui/material": "^5.11.
|
|
57
|
+
"@mui/icons-material": "^5.11.9",
|
|
58
|
+
"@mui/material": "^5.11.9",
|
|
59
59
|
"@types/pica": "^9.0.1",
|
|
60
60
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
61
61
|
"@types/react": "^18.0.28",
|
|
62
62
|
"@types/react-avatar-editor": "^13.0.0",
|
|
63
|
-
"@types/react-dom": "^18.0.
|
|
63
|
+
"@types/react-dom": "^18.0.11",
|
|
64
64
|
"@types/react-input-mask": "^3.0.2",
|
|
65
65
|
"@types/react-window": "^1.8.5",
|
|
66
66
|
"pica": "^9.0.1",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"@testing-library/jest-dom": "^5.16.5",
|
|
85
85
|
"@testing-library/react": "^13.4.0",
|
|
86
86
|
"@types/jest": "^29.4.0",
|
|
87
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
88
|
-
"@typescript-eslint/parser": "^5.
|
|
89
|
-
"jest": "^29.4.
|
|
90
|
-
"jest-environment-jsdom": "^29.4.
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^5.52.0",
|
|
88
|
+
"@typescript-eslint/parser": "^5.52.0",
|
|
89
|
+
"jest": "^29.4.3",
|
|
90
|
+
"jest-environment-jsdom": "^29.4.3",
|
|
91
91
|
"typescript": "^4.9.5"
|
|
92
92
|
}
|
|
93
93
|
}
|
package/src/ComboBox.tsx
CHANGED
|
@@ -173,8 +173,10 @@ export function ComboBox<
|
|
|
173
173
|
const [stateValue, setStateValue] = React.useState<T | T[] | null>(null);
|
|
174
174
|
|
|
175
175
|
React.useEffect(() => {
|
|
176
|
-
if (localValue != null
|
|
177
|
-
|
|
176
|
+
if (localValue != null && localValue != stateValue) {
|
|
177
|
+
setStateValue(localValue);
|
|
178
|
+
}
|
|
179
|
+
}, [localValue]);
|
|
178
180
|
|
|
179
181
|
// Add readOnly
|
|
180
182
|
const addReadOnly = (params: AutocompleteRenderInputParams) => {
|
|
@@ -235,14 +237,7 @@ export function ComboBox<
|
|
|
235
237
|
}
|
|
236
238
|
setOptions(result);
|
|
237
239
|
});
|
|
238
|
-
}, [
|
|
239
|
-
propertyWay,
|
|
240
|
-
loadData,
|
|
241
|
-
onLoadData,
|
|
242
|
-
autoAddBlankItem,
|
|
243
|
-
idField,
|
|
244
|
-
labelField
|
|
245
|
-
]);
|
|
240
|
+
}, [propertyWay, autoAddBlankItem, idField, labelField]);
|
|
246
241
|
|
|
247
242
|
React.useEffect(() => {
|
|
248
243
|
return () => {
|