@etsoo/react 1.3.27 → 1.3.28
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/mu/ItemList.d.ts +1 -1
- package/lib/mu/ItemList.js +4 -2
- package/package.json +3 -3
- package/src/mu/ItemList.tsx +5 -3
package/lib/mu/ItemList.d.ts
CHANGED
package/lib/mu/ItemList.js
CHANGED
|
@@ -38,11 +38,13 @@ export function ItemList(props) {
|
|
|
38
38
|
};
|
|
39
39
|
// Close handler
|
|
40
40
|
const closeHandler = () => {
|
|
41
|
+
if (!open)
|
|
42
|
+
return;
|
|
41
43
|
// Close the dialog
|
|
42
44
|
setOpen(false);
|
|
43
45
|
// Emit close event
|
|
44
46
|
if (onClose) {
|
|
45
|
-
onClose(currentItem);
|
|
47
|
+
onClose(currentItem, false);
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
// Close item handler
|
|
@@ -53,7 +55,7 @@ export function ItemList(props) {
|
|
|
53
55
|
setOpen(false);
|
|
54
56
|
// Emit close event
|
|
55
57
|
if (onClose) {
|
|
56
|
-
onClose(item);
|
|
58
|
+
onClose(item, true);
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
return (React.createElement(React.Fragment, null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.28",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
80
80
|
"@babel/preset-env": "^7.16.4",
|
|
81
81
|
"@babel/runtime-corejs3": "^7.16.3",
|
|
82
|
-
"@types/jest": "^27.0.
|
|
82
|
+
"@types/jest": "^27.0.3",
|
|
83
83
|
"@types/react-test-renderer": "^17.0.1",
|
|
84
84
|
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
85
85
|
"@typescript-eslint/parser": "^5.4.0",
|
|
86
86
|
"eslint": "^8.2.0",
|
|
87
87
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
88
88
|
"eslint-plugin-import": "^2.25.3",
|
|
89
|
-
"eslint-plugin-react": "^7.27.
|
|
89
|
+
"eslint-plugin-react": "^7.27.1",
|
|
90
90
|
"jest": "^27.3.1",
|
|
91
91
|
"react-test-renderer": "^17.0.2",
|
|
92
92
|
"ts-jest": "^27.0.7",
|
package/src/mu/ItemList.tsx
CHANGED
|
@@ -48,7 +48,7 @@ export interface ItemListProps {
|
|
|
48
48
|
/**
|
|
49
49
|
* Close event
|
|
50
50
|
*/
|
|
51
|
-
onClose?(item
|
|
51
|
+
onClose?(item: any, changed: boolean): void;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Current selected language
|
|
@@ -133,12 +133,14 @@ export function ItemList(props: ItemListProps) {
|
|
|
133
133
|
|
|
134
134
|
// Close handler
|
|
135
135
|
const closeHandler = () => {
|
|
136
|
+
if (!open) return;
|
|
137
|
+
|
|
136
138
|
// Close the dialog
|
|
137
139
|
setOpen(false);
|
|
138
140
|
|
|
139
141
|
// Emit close event
|
|
140
142
|
if (onClose) {
|
|
141
|
-
onClose(currentItem);
|
|
143
|
+
onClose(currentItem, false);
|
|
142
144
|
}
|
|
143
145
|
};
|
|
144
146
|
|
|
@@ -152,7 +154,7 @@ export function ItemList(props: ItemListProps) {
|
|
|
152
154
|
|
|
153
155
|
// Emit close event
|
|
154
156
|
if (onClose) {
|
|
155
|
-
onClose(item);
|
|
157
|
+
onClose(item, true);
|
|
156
158
|
}
|
|
157
159
|
};
|
|
158
160
|
|