@etsoo/materialui 1.1.89 → 1.1.91
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/IntInputField.js +3 -0
- package/lib/ItemList.js +5 -5
- package/package.json +4 -4
- package/src/IntInputField.tsx +2 -0
- package/src/ItemList.tsx +7 -5
package/lib/IntInputField.js
CHANGED
package/lib/ItemList.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Dialog, DialogTitle, List, ListItemText, DialogContent, Button, ListItemButton
|
|
3
|
-
import { DataTypes
|
|
2
|
+
import { Dialog, DialogTitle, List, ListItemText, DialogContent, Button, ListItemButton } from "@mui/material";
|
|
3
|
+
import { DataTypes } from "@etsoo/shared";
|
|
4
4
|
/**
|
|
5
5
|
* Item list component
|
|
6
6
|
* @param props Properties
|
|
7
7
|
*/
|
|
8
8
|
export function ItemList(props) {
|
|
9
9
|
// properties destructure
|
|
10
|
-
const { buttonLabel, className, color = "primary", keepClick = false, items, idField = "id", labelField = "label", minWidth, icon, onClose, selectedValue, size = "medium", title, variant = "outlined"
|
|
10
|
+
const { buttonLabel, className, color = "primary", keepClick = false, items, idField = "id", labelField = "label", minWidth, icon, onClose, selectedValue, size = "medium", title, variant = "outlined" } = props;
|
|
11
11
|
// Get label
|
|
12
12
|
const getLabel = (item) => {
|
|
13
13
|
var _a;
|
|
@@ -26,8 +26,8 @@ export function ItemList(props) {
|
|
|
26
26
|
const [currentItem, setCurrentItem] = React.useState(defaultItem);
|
|
27
27
|
// Click handler
|
|
28
28
|
const clickHandler = () => {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (items.length < 1 ||
|
|
30
|
+
(items.length === 1 && !keepClick && defaultItem != null)) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
// Open the dialog
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.91",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.24",
|
|
55
55
|
"@etsoo/react": "^1.6.58",
|
|
56
56
|
"@etsoo/shared": "^1.1.96",
|
|
57
|
-
"@mui/icons-material": "^5.11.
|
|
58
|
-
"@mui/material": "^5.11.
|
|
57
|
+
"@mui/icons-material": "^5.11.16",
|
|
58
|
+
"@mui/material": "^5.11.16",
|
|
59
59
|
"@mui/x-data-grid": "^6.0.4",
|
|
60
60
|
"@types/pica": "^9.0.1",
|
|
61
61
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"react-avatar-editor": "^13.0.0",
|
|
71
71
|
"react-dom": "^18.2.0",
|
|
72
72
|
"react-draggable": "^4.4.5",
|
|
73
|
-
"react-imask": "^6.
|
|
73
|
+
"react-imask": "^6.5.0",
|
|
74
74
|
"react-router-dom": "^6.10.0",
|
|
75
75
|
"react-window": "^1.8.8"
|
|
76
76
|
},
|
package/src/IntInputField.tsx
CHANGED
package/src/ItemList.tsx
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
ListItemText,
|
|
7
7
|
DialogContent,
|
|
8
8
|
Button,
|
|
9
|
-
ListItemButton
|
|
9
|
+
ListItemButton
|
|
10
10
|
} from "@mui/material";
|
|
11
11
|
import {
|
|
12
12
|
DataTypes,
|
|
13
13
|
IdDefaultType,
|
|
14
14
|
LabelDefaultType,
|
|
15
|
-
ListType
|
|
15
|
+
ListType
|
|
16
16
|
} from "@etsoo/shared";
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -118,7 +118,7 @@ export function ItemList<
|
|
|
118
118
|
selectedValue,
|
|
119
119
|
size = "medium",
|
|
120
120
|
title,
|
|
121
|
-
variant = "outlined"
|
|
121
|
+
variant = "outlined"
|
|
122
122
|
} = props;
|
|
123
123
|
|
|
124
124
|
// Get label
|
|
@@ -143,8 +143,10 @@ export function ItemList<
|
|
|
143
143
|
|
|
144
144
|
// Click handler
|
|
145
145
|
const clickHandler = () => {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
if (
|
|
147
|
+
items.length < 1 ||
|
|
148
|
+
(items.length === 1 && !keepClick && defaultItem != null)
|
|
149
|
+
) {
|
|
148
150
|
return;
|
|
149
151
|
}
|
|
150
152
|
|