@etsoo/materialui 1.1.31 → 1.1.32
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/MoneyInputField.d.ts +11 -0
- package/lib/MoneyInputField.js +11 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +1 -1
- package/src/MoneyInputField.tsx +33 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputBaseProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { InputFieldProps } from "./InputField";
|
|
4
|
+
/**
|
|
5
|
+
* Money input field props
|
|
6
|
+
*/
|
|
7
|
+
export type MoneyInputFieldProps = Omit<InputFieldProps, "type" | "inputProps"> & InputBaseProps["inputProps"];
|
|
8
|
+
/**
|
|
9
|
+
* Money input field
|
|
10
|
+
*/
|
|
11
|
+
export declare const MoneyInputField: 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
|
+
* Money input field
|
|
5
|
+
*/
|
|
6
|
+
export const MoneyInputField = React.forwardRef((props, ref) => {
|
|
7
|
+
// Destruct
|
|
8
|
+
const { min = 0, step = 0.01, 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
|
@@ -56,6 +56,7 @@ export * from "./ListMoreDisplay";
|
|
|
56
56
|
export * from "./LoadingButton";
|
|
57
57
|
export * from "./MaskInput";
|
|
58
58
|
export * from "./MobileListItemRenderer";
|
|
59
|
+
export * from "./MoneyInputField";
|
|
59
60
|
export * from "./MoreFab";
|
|
60
61
|
export * from "./MUGlobal";
|
|
61
62
|
export * from "./NotifierMU";
|
package/lib/index.js
CHANGED
|
@@ -56,6 +56,7 @@ export * from "./ListMoreDisplay";
|
|
|
56
56
|
export * from "./LoadingButton";
|
|
57
57
|
export * from "./MaskInput";
|
|
58
58
|
export * from "./MobileListItemRenderer";
|
|
59
|
+
export * from "./MoneyInputField";
|
|
59
60
|
export * from "./MoreFab";
|
|
60
61
|
export * from "./MUGlobal";
|
|
61
62
|
export * from "./NotifierMU";
|
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InputBaseProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { InputField, InputFieldProps } from "./InputField";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Money input field props
|
|
7
|
+
*/
|
|
8
|
+
export type MoneyInputFieldProps = Omit<
|
|
9
|
+
InputFieldProps,
|
|
10
|
+
"type" | "inputProps"
|
|
11
|
+
> &
|
|
12
|
+
InputBaseProps["inputProps"];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Money input field
|
|
16
|
+
*/
|
|
17
|
+
export const MoneyInputField = React.forwardRef<
|
|
18
|
+
HTMLDivElement,
|
|
19
|
+
MoneyInputFieldProps
|
|
20
|
+
>((props, ref) => {
|
|
21
|
+
// Destruct
|
|
22
|
+
const { min = 0, step = 0.01, max = 9999999, ...rest } = props;
|
|
23
|
+
|
|
24
|
+
// Layout
|
|
25
|
+
return (
|
|
26
|
+
<InputField
|
|
27
|
+
ref={ref}
|
|
28
|
+
type="number"
|
|
29
|
+
inputProps={{ min, step, max, inputMode: "numeric" }}
|
|
30
|
+
{...rest}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -59,6 +59,7 @@ export * from "./ListMoreDisplay";
|
|
|
59
59
|
export * from "./LoadingButton";
|
|
60
60
|
export * from "./MaskInput";
|
|
61
61
|
export * from "./MobileListItemRenderer";
|
|
62
|
+
export * from "./MoneyInputField";
|
|
62
63
|
export * from "./MoreFab";
|
|
63
64
|
export * from "./MUGlobal";
|
|
64
65
|
export * from "./NotifierMU";
|