@etsoo/materialui 1.1.32 → 1.1.34
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 +1 -1
- package/lib/IntInputField.d.ts +11 -0
- package/lib/IntInputField.js +11 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +2 -2
- package/src/ComboBox.tsx +1 -1
- package/src/IntInputField.tsx +30 -0
- package/src/index.ts +1 -0
package/lib/ComboBox.js
CHANGED
|
@@ -62,7 +62,7 @@ export function ComboBox(props) {
|
|
|
62
62
|
React.useEffect(() => {
|
|
63
63
|
if (localValue != null)
|
|
64
64
|
setStateValue(localValue);
|
|
65
|
-
}, [localValue]);
|
|
65
|
+
}, [JSON.stringify(localValue) != JSON.stringify(stateValue)]);
|
|
66
66
|
// Add readOnly
|
|
67
67
|
const addReadOnly = (params) => {
|
|
68
68
|
if (readOnly != null) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputBaseProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { InputFieldProps } from "./InputField";
|
|
4
|
+
/**
|
|
5
|
+
* Integer input field props
|
|
6
|
+
*/
|
|
7
|
+
export type IntInputFieldProps = Omit<InputFieldProps, "type" | "inputProps"> & InputBaseProps["inputProps"];
|
|
8
|
+
/**
|
|
9
|
+
* Integer input field
|
|
10
|
+
*/
|
|
11
|
+
export declare const IntInputField: React.ForwardRefExoticComponent<Omit<Omit<InputFieldProps, "type" | "inputProps"> & import("@mui/material").InputBaseComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputField } from "./InputField";
|
|
3
|
+
/**
|
|
4
|
+
* Integer input field
|
|
5
|
+
*/
|
|
6
|
+
export const IntInputField = React.forwardRef((props, ref) => {
|
|
7
|
+
// Destruct
|
|
8
|
+
const { min = 0, step = 1, max = 9999999, ...rest } = props;
|
|
9
|
+
// Layout
|
|
10
|
+
return (React.createElement(InputField, { ref: ref, type: "number", inputProps: { min, step, max, inputMode: "numeric" }, ...rest }));
|
|
11
|
+
});
|
package/lib/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export * from "./HiSelector";
|
|
|
49
49
|
export * from "./HiSelectorTL";
|
|
50
50
|
export * from "./IconButtonLink";
|
|
51
51
|
export * from "./InputField";
|
|
52
|
+
export * from "./IntInputField";
|
|
52
53
|
export * from "./ItemList";
|
|
53
54
|
export * from "./ListChooser";
|
|
54
55
|
export * from "./ListItemRightIcon";
|
package/lib/index.js
CHANGED
|
@@ -49,6 +49,7 @@ export * from "./HiSelector";
|
|
|
49
49
|
export * from "./HiSelectorTL";
|
|
50
50
|
export * from "./IconButtonLink";
|
|
51
51
|
export * from "./InputField";
|
|
52
|
+
export * from "./IntInputField";
|
|
52
53
|
export * from "./ItemList";
|
|
53
54
|
export * from "./ListChooser";
|
|
54
55
|
export * from "./ListItemRightIcon";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.34",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
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.64",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.23",
|
|
55
55
|
"@etsoo/react": "^1.6.47",
|
|
56
56
|
"@etsoo/shared": "^1.1.88",
|
package/src/ComboBox.tsx
CHANGED
|
@@ -174,7 +174,7 @@ export function ComboBox<
|
|
|
174
174
|
|
|
175
175
|
React.useEffect(() => {
|
|
176
176
|
if (localValue != null) setStateValue(localValue);
|
|
177
|
-
}, [localValue]);
|
|
177
|
+
}, [JSON.stringify(localValue) != JSON.stringify(stateValue)]);
|
|
178
178
|
|
|
179
179
|
// Add readOnly
|
|
180
180
|
const addReadOnly = (params: AutocompleteRenderInputParams) => {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { InputBaseProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { InputField, InputFieldProps } from "./InputField";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Integer input field props
|
|
7
|
+
*/
|
|
8
|
+
export type IntInputFieldProps = Omit<InputFieldProps, "type" | "inputProps"> &
|
|
9
|
+
InputBaseProps["inputProps"];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Integer input field
|
|
13
|
+
*/
|
|
14
|
+
export const IntInputField = React.forwardRef<
|
|
15
|
+
HTMLDivElement,
|
|
16
|
+
IntInputFieldProps
|
|
17
|
+
>((props, ref) => {
|
|
18
|
+
// Destruct
|
|
19
|
+
const { min = 0, step = 1, max = 9999999, ...rest } = props;
|
|
20
|
+
|
|
21
|
+
// Layout
|
|
22
|
+
return (
|
|
23
|
+
<InputField
|
|
24
|
+
ref={ref}
|
|
25
|
+
type="number"
|
|
26
|
+
inputProps={{ min, step, max, inputMode: "numeric" }}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -52,6 +52,7 @@ export * from "./HiSelector";
|
|
|
52
52
|
export * from "./HiSelectorTL";
|
|
53
53
|
export * from "./IconButtonLink";
|
|
54
54
|
export * from "./InputField";
|
|
55
|
+
export * from "./IntInputField";
|
|
55
56
|
export * from "./ItemList";
|
|
56
57
|
export * from "./ListChooser";
|
|
57
58
|
export * from "./ListItemRightIcon";
|