@etsoo/materialui 1.3.15 → 1.3.17
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.d.ts +1 -1
- package/lib/IntInputField.js +1 -1
- package/lib/MoneyInputField.d.ts +1 -1
- package/lib/MoneyInputField.js +1 -1
- package/lib/NumberInputField.d.ts +29 -0
- package/lib/NumberInputField.js +17 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +2 -2
- package/src/IntInputField.tsx +1 -1
- package/src/MoneyInputField.tsx +1 -1
- package/src/NumberInputField.tsx +52 -0
- package/src/index.ts +1 -0
package/lib/IntInputField.d.ts
CHANGED
|
@@ -50,6 +50,6 @@ export type IntInputFieldProps = Omit<InputFieldProps, "type" | "inputProps" | "
|
|
|
50
50
|
boxProps?: BoxProps;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
|
-
* Integer input field
|
|
53
|
+
* Integer input field (controlled)
|
|
54
54
|
*/
|
|
55
55
|
export declare const IntInputField: React.ForwardRefExoticComponent<Omit<IntInputFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/lib/IntInputField.js
CHANGED
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
import { NumberUtils } from "@etsoo/shared";
|
|
6
6
|
import { InputField } from "./InputField";
|
|
7
7
|
/**
|
|
8
|
-
* Integer input field
|
|
8
|
+
* Integer input field (controlled)
|
|
9
9
|
*/
|
|
10
10
|
export const IntInputField = React.forwardRef((props, ref) => {
|
|
11
11
|
// Destruct
|
package/lib/MoneyInputField.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ import { IntInputFieldProps } from "./IntInputField";
|
|
|
5
5
|
*/
|
|
6
6
|
export type MoneyInputFieldProps = IntInputFieldProps & {};
|
|
7
7
|
/**
|
|
8
|
-
* Money input field
|
|
8
|
+
* Money input field (controlled)
|
|
9
9
|
*/
|
|
10
10
|
export declare const MoneyInputField: React.ForwardRefExoticComponent<Omit<MoneyInputFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/lib/MoneyInputField.js
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputFieldProps } from "./InputField";
|
|
3
|
+
/**
|
|
4
|
+
* Number input field properties
|
|
5
|
+
*/
|
|
6
|
+
export type NumberInputFieldProps = Omit<InputFieldProps, "type" | "inputProps"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Input field style
|
|
9
|
+
*/
|
|
10
|
+
inputStyle?: React.CSSProperties;
|
|
11
|
+
/**
|
|
12
|
+
* Minimum value
|
|
13
|
+
*/
|
|
14
|
+
min?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Maximum value
|
|
17
|
+
*/
|
|
18
|
+
max?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Step value
|
|
21
|
+
*/
|
|
22
|
+
step?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Number input field, for controlled only components, please see IntInputField and MoneyInputField
|
|
26
|
+
* @param props Props
|
|
27
|
+
* @returns Component
|
|
28
|
+
*/
|
|
29
|
+
export declare function NumberInputField(props: NumberInputFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputField } from "./InputField";
|
|
3
|
+
/**
|
|
4
|
+
* Number input field, for controlled only components, please see IntInputField and MoneyInputField
|
|
5
|
+
* @param props Props
|
|
6
|
+
* @returns Component
|
|
7
|
+
*/
|
|
8
|
+
export function NumberInputField(props) {
|
|
9
|
+
const { inputStyle, min = 0, step = 1, max = 9999999, ...rest } = props;
|
|
10
|
+
return (React.createElement(InputField, { inputProps: {
|
|
11
|
+
min,
|
|
12
|
+
step,
|
|
13
|
+
max,
|
|
14
|
+
style: inputStyle,
|
|
15
|
+
inputMode: "numeric"
|
|
16
|
+
}, ...rest }));
|
|
17
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export * from "./MUGlobal";
|
|
|
79
79
|
export * from "./MUUtils";
|
|
80
80
|
export * from "./NotifierMU";
|
|
81
81
|
export * from "./NotifierPopupProps";
|
|
82
|
+
export * from "./NumberInputField";
|
|
82
83
|
export * from "./OptionBool";
|
|
83
84
|
export * from "./OptionGroup";
|
|
84
85
|
export * from "./PercentCircularProgress";
|
package/lib/index.js
CHANGED
|
@@ -79,6 +79,7 @@ export * from "./MUGlobal";
|
|
|
79
79
|
export * from "./MUUtils";
|
|
80
80
|
export * from "./NotifierMU";
|
|
81
81
|
export * from "./NotifierPopupProps";
|
|
82
|
+
export * from "./NumberInputField";
|
|
82
83
|
export * from "./OptionBool";
|
|
83
84
|
export * from "./OptionGroup";
|
|
84
85
|
export * from "./PercentCircularProgress";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@emotion/styled": "^11.11.0",
|
|
53
53
|
"@etsoo/appscript": "^1.4.53",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.28",
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
55
|
+
"@etsoo/react": "^1.7.11",
|
|
56
56
|
"@etsoo/shared": "^1.2.12",
|
|
57
57
|
"@mui/icons-material": "^5.14.9",
|
|
58
58
|
"@mui/material": "^5.14.9",
|
package/src/IntInputField.tsx
CHANGED
package/src/MoneyInputField.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { IntInputField, IntInputFieldProps } from "./IntInputField";
|
|
|
7
7
|
export type MoneyInputFieldProps = IntInputFieldProps & {};
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Money input field
|
|
10
|
+
* Money input field (controlled)
|
|
11
11
|
*/
|
|
12
12
|
export const MoneyInputField = React.forwardRef<
|
|
13
13
|
HTMLDivElement,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputField, InputFieldProps } from "./InputField";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Number input field properties
|
|
6
|
+
*/
|
|
7
|
+
export type NumberInputFieldProps = Omit<
|
|
8
|
+
InputFieldProps,
|
|
9
|
+
"type" | "inputProps"
|
|
10
|
+
> & {
|
|
11
|
+
/**
|
|
12
|
+
* Input field style
|
|
13
|
+
*/
|
|
14
|
+
inputStyle?: React.CSSProperties;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Minimum value
|
|
18
|
+
*/
|
|
19
|
+
min?: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Maximum value
|
|
23
|
+
*/
|
|
24
|
+
max?: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Step value
|
|
28
|
+
*/
|
|
29
|
+
step?: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Number input field, for controlled only components, please see IntInputField and MoneyInputField
|
|
34
|
+
* @param props Props
|
|
35
|
+
* @returns Component
|
|
36
|
+
*/
|
|
37
|
+
export function NumberInputField(props: NumberInputFieldProps) {
|
|
38
|
+
const { inputStyle, min = 0, step = 1, max = 9999999, ...rest } = props;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<InputField
|
|
42
|
+
inputProps={{
|
|
43
|
+
min,
|
|
44
|
+
step,
|
|
45
|
+
max,
|
|
46
|
+
style: inputStyle,
|
|
47
|
+
inputMode: "numeric"
|
|
48
|
+
}}
|
|
49
|
+
{...rest}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -83,6 +83,7 @@ export * from "./MUGlobal";
|
|
|
83
83
|
export * from "./MUUtils";
|
|
84
84
|
export * from "./NotifierMU";
|
|
85
85
|
export * from "./NotifierPopupProps";
|
|
86
|
+
export * from "./NumberInputField";
|
|
86
87
|
export * from "./OptionBool";
|
|
87
88
|
export * from "./OptionGroup";
|
|
88
89
|
export * from "./PercentCircularProgress";
|