@etsoo/materialui 1.5.84 → 1.5.86
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/cjs/CountdownButton.d.ts +1 -2
- package/lib/cjs/CountdownButton.js +4 -4
- package/lib/cjs/EmailInput.d.ts +2 -2
- package/lib/cjs/EmailInput.js +2 -5
- package/lib/cjs/InputField.d.ts +1 -52
- package/lib/cjs/InputField.js +5 -5
- package/lib/cjs/InputTipField.d.ts +40 -20
- package/lib/cjs/InputTipField.js +13 -2
- package/lib/cjs/IntInputField.d.ts +1 -1
- package/lib/cjs/IntInputField.js +9 -12
- package/lib/cjs/MobileInput.d.ts +2 -2
- package/lib/cjs/MobileInput.js +2 -5
- package/lib/cjs/MoneyInputField.d.ts +1 -2
- package/lib/cjs/MoneyInputField.js +4 -8
- package/lib/cjs/PhoneInput.d.ts +2 -2
- package/lib/cjs/PhoneInput.js +2 -5
- package/lib/cjs/TextFieldEx.d.ts +5 -106
- package/lib/cjs/TextFieldEx.js +27 -18
- package/lib/mjs/CountdownButton.d.ts +1 -2
- package/lib/mjs/CountdownButton.js +3 -3
- package/lib/mjs/EmailInput.d.ts +2 -2
- package/lib/mjs/EmailInput.js +2 -2
- package/lib/mjs/InputField.d.ts +1 -52
- package/lib/mjs/InputField.js +4 -4
- package/lib/mjs/InputTipField.d.ts +40 -20
- package/lib/mjs/InputTipField.js +13 -2
- package/lib/mjs/IntInputField.d.ts +1 -1
- package/lib/mjs/IntInputField.js +8 -11
- package/lib/mjs/MobileInput.d.ts +2 -2
- package/lib/mjs/MobileInput.js +2 -2
- package/lib/mjs/MoneyInputField.d.ts +1 -2
- package/lib/mjs/MoneyInputField.js +3 -4
- package/lib/mjs/PhoneInput.d.ts +2 -2
- package/lib/mjs/PhoneInput.js +2 -2
- package/lib/mjs/TextFieldEx.d.ts +5 -106
- package/lib/mjs/TextFieldEx.js +26 -17
- package/package.json +8 -8
- package/src/CountdownButton.tsx +2 -6
- package/src/EmailInput.tsx +3 -3
- package/src/InputField.tsx +69 -74
- package/src/InputTipField.tsx +49 -14
- package/src/IntInputField.tsx +14 -22
- package/src/MobileInput.tsx +3 -3
- package/src/MoneyInputField.tsx +3 -7
- package/src/PhoneInput.tsx +3 -3
- package/src/TextFieldEx.tsx +33 -20
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonProps } from "@mui/material/Button";
|
|
2
|
-
import React from "react";
|
|
3
2
|
/**
|
|
4
3
|
* Countdown button action
|
|
5
4
|
*/
|
|
@@ -24,4 +23,4 @@ export type CountdownButtonProps = Omit<ButtonProps, "endIcon" | "disabled"> & {
|
|
|
24
23
|
* @param props Props
|
|
25
24
|
* @returns Button
|
|
26
25
|
*/
|
|
27
|
-
export declare
|
|
26
|
+
export declare function CountdownButton(props: CountdownButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CountdownButton =
|
|
6
|
+
exports.CountdownButton = CountdownButton;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
9
9
|
const CircularProgress_1 = __importDefault(require("@mui/material/CircularProgress"));
|
|
@@ -13,7 +13,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
13
13
|
* @param props Props
|
|
14
14
|
* @returns Button
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
function CountdownButton(props) {
|
|
17
17
|
// Destructure
|
|
18
18
|
const { initState = 0, onAction, onClick, ...rest } = props;
|
|
19
19
|
// State
|
|
@@ -88,5 +88,5 @@ exports.CountdownButton = react_1.default.forwardRef((props, ref) => {
|
|
|
88
88
|
react_1.default.useEffect(() => {
|
|
89
89
|
setState(initState);
|
|
90
90
|
}, [initState]);
|
|
91
|
-
return ((0, jsx_runtime_1.jsx)(Button_1.default, { disabled: disabled, endIcon: endIcon, onClick: localClick,
|
|
92
|
-
}
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.default, { disabled: disabled, endIcon: endIcon, onClick: localClick, ...rest }));
|
|
92
|
+
}
|
package/lib/cjs/EmailInput.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputFieldProps } from "./InputField";
|
|
2
2
|
/**
|
|
3
3
|
* Email input props
|
|
4
4
|
*/
|
|
5
|
-
export type EmailInputProps = Omit<
|
|
5
|
+
export type EmailInputProps = Omit<InputFieldProps, "type"> & {};
|
|
6
6
|
/**
|
|
7
7
|
* Email input
|
|
8
8
|
* @param props Props
|
package/lib/cjs/EmailInput.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.EmailInput = EmailInput;
|
|
7
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
9
5
|
const ReactApp_1 = require("./app/ReactApp");
|
|
10
6
|
const MUGlobal_1 = require("./MUGlobal");
|
|
7
|
+
const InputField_1 = require("./InputField");
|
|
11
8
|
/**
|
|
12
9
|
* Email input
|
|
13
10
|
* @param props Props
|
|
@@ -20,7 +17,7 @@ function EmailInput(props) {
|
|
|
20
17
|
// Slot props
|
|
21
18
|
const { htmlInput, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
22
19
|
// Layout
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { type: "email", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
|
|
24
21
|
htmlInput: { inputMode: "email", maxLength: 128, ...htmlInput },
|
|
25
22
|
inputLabel: { shrink: MUGlobal_1.MUGlobal.inputFieldShrink, ...inputLabel },
|
|
26
23
|
...restSlotProps
|
package/lib/cjs/InputField.d.ts
CHANGED
|
@@ -26,55 +26,4 @@ export type InputFieldProps = TextFieldProps & {
|
|
|
26
26
|
* @param props Props
|
|
27
27
|
* @returns Component
|
|
28
28
|
*/
|
|
29
|
-
export declare
|
|
30
|
-
/**
|
|
31
|
-
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
32
|
-
*/
|
|
33
|
-
changeDelay?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Change delay handler, without it onChange will be applied
|
|
36
|
-
*/
|
|
37
|
-
onChangeDelay?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
|
|
38
|
-
/**
|
|
39
|
-
* Is the field read only?
|
|
40
|
-
*/
|
|
41
|
-
readOnly?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Minimum characters to trigger the change event
|
|
44
|
-
*/
|
|
45
|
-
minChars?: number;
|
|
46
|
-
}, "ref"> | Omit<import("@mui/material/TextField").OutlinedTextFieldProps & {
|
|
47
|
-
/**
|
|
48
|
-
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
49
|
-
*/
|
|
50
|
-
changeDelay?: number;
|
|
51
|
-
/**
|
|
52
|
-
* Change delay handler, without it onChange will be applied
|
|
53
|
-
*/
|
|
54
|
-
onChangeDelay?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
|
|
55
|
-
/**
|
|
56
|
-
* Is the field read only?
|
|
57
|
-
*/
|
|
58
|
-
readOnly?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Minimum characters to trigger the change event
|
|
61
|
-
*/
|
|
62
|
-
minChars?: number;
|
|
63
|
-
}, "ref"> | Omit<import("@mui/material/TextField").FilledTextFieldProps & {
|
|
64
|
-
/**
|
|
65
|
-
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
66
|
-
*/
|
|
67
|
-
changeDelay?: number;
|
|
68
|
-
/**
|
|
69
|
-
* Change delay handler, without it onChange will be applied
|
|
70
|
-
*/
|
|
71
|
-
onChangeDelay?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
|
|
72
|
-
/**
|
|
73
|
-
* Is the field read only?
|
|
74
|
-
*/
|
|
75
|
-
readOnly?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Minimum characters to trigger the change event
|
|
78
|
-
*/
|
|
79
|
-
minChars?: number;
|
|
80
|
-
}, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export declare function InputField(props: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/cjs/InputField.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InputField =
|
|
6
|
+
exports.InputField = InputField;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("@etsoo/react");
|
|
9
9
|
const react_2 = __importDefault(require("react"));
|
|
@@ -14,9 +14,9 @@ const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
|
14
14
|
* @param props Props
|
|
15
15
|
* @returns Component
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
function InputField(props) {
|
|
18
18
|
// Destruct
|
|
19
|
-
const { InputProps = {}, inputProps = {},
|
|
19
|
+
const { InputProps = {}, inputProps = {}, slotProps, changeDelay, onChange, onChangeDelay, readOnly, size = MUGlobal_1.MUGlobal.inputFieldSize, variant = MUGlobal_1.MUGlobal.inputFieldVariant, minChars = 0, ...rest } = props;
|
|
20
20
|
// Slot props
|
|
21
21
|
const { htmlInput, input, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
22
22
|
const isMounted = react_2.default.useRef(true);
|
|
@@ -49,7 +49,7 @@ exports.InputField = react_2.default.forwardRef((props, ref) => {
|
|
|
49
49
|
};
|
|
50
50
|
}, []);
|
|
51
51
|
// Layout
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(TextField_1.default, {
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(TextField_1.default, { slotProps: {
|
|
53
53
|
htmlInput: {
|
|
54
54
|
["data-min-chars"]: minChars,
|
|
55
55
|
...htmlInput,
|
|
@@ -62,4 +62,4 @@ exports.InputField = react_2.default.forwardRef((props, ref) => {
|
|
|
62
62
|
},
|
|
63
63
|
...restSlotProps
|
|
64
64
|
}, onChange: onChangeEx, size: size, variant: variant, ...rest }));
|
|
65
|
-
}
|
|
65
|
+
}
|
|
@@ -1,38 +1,58 @@
|
|
|
1
1
|
import { DataTypes } from "@etsoo/shared";
|
|
2
2
|
import { TypographyProps } from "@mui/material/Typography";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { InputField } from "./InputField";
|
|
5
|
+
import { EmailInput } from "./EmailInput";
|
|
6
|
+
import { MobileInput } from "./MobileInput";
|
|
7
|
+
import { PhoneInput } from "./PhoneInput";
|
|
5
8
|
type ItemType = DataTypes.IdLabelItem<string | number>;
|
|
9
|
+
declare const componentMap: {
|
|
10
|
+
input: typeof InputField;
|
|
11
|
+
email: typeof EmailInput;
|
|
12
|
+
phone: typeof PhoneInput;
|
|
13
|
+
mobile: typeof MobileInput;
|
|
14
|
+
};
|
|
15
|
+
type ComponentMap = typeof componentMap;
|
|
16
|
+
type ComponentKey = keyof ComponentMap;
|
|
6
17
|
/**
|
|
7
18
|
* InputField with tips properties
|
|
8
19
|
*/
|
|
9
|
-
export type InputTipFieldProps<T extends ItemType = ItemType> =
|
|
10
|
-
/**
|
|
11
|
-
* Load data
|
|
12
|
-
* @param value Duplicate test value
|
|
13
|
-
*/
|
|
14
|
-
loadData(value: string): Promise<[T[]?, string?]>;
|
|
15
|
-
/**
|
|
16
|
-
* Label props
|
|
17
|
-
*/
|
|
18
|
-
labelProps?: Omit<TypographyProps, "onClick">;
|
|
20
|
+
export type InputTipFieldProps<T extends ItemType = ItemType, K extends ComponentKey = "input"> = Omit<React.ComponentProps<ComponentMap[K]>, "component"> & {
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @param item List item data
|
|
22
|
-
* @returns Result
|
|
22
|
+
* Component key
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
component?: K;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param item List item data
|
|
28
|
-
* @returns Result
|
|
26
|
+
* Component properties
|
|
29
27
|
*/
|
|
30
|
-
|
|
28
|
+
componentProps: {
|
|
29
|
+
/**
|
|
30
|
+
* Load data
|
|
31
|
+
* @param value Duplicate test value
|
|
32
|
+
*/
|
|
33
|
+
loadData(value: string): Promise<[T[]?, string?]>;
|
|
34
|
+
/**
|
|
35
|
+
* Label props
|
|
36
|
+
*/
|
|
37
|
+
labelProps?: Omit<TypographyProps, "onClick">;
|
|
38
|
+
/**
|
|
39
|
+
* Custom item label
|
|
40
|
+
* @param item List item data
|
|
41
|
+
* @returns Result
|
|
42
|
+
*/
|
|
43
|
+
itemLabel?: (item: T) => React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Custom render item
|
|
46
|
+
* @param item List item data
|
|
47
|
+
* @returns Result
|
|
48
|
+
*/
|
|
49
|
+
renderItem?: (item: T) => React.ReactNode;
|
|
50
|
+
};
|
|
31
51
|
};
|
|
32
52
|
/**
|
|
33
53
|
* InputField with tips
|
|
34
54
|
* @param props Props
|
|
35
55
|
* @returns Component
|
|
36
56
|
*/
|
|
37
|
-
export declare function InputTipField<T extends ItemType = ItemType>(props: InputTipFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare function InputTipField<T extends ItemType = ItemType, K extends ComponentKey = "input">(props: InputTipFieldProps<T, K>): import("react/jsx-runtime").JSX.Element;
|
|
38
58
|
export {};
|
package/lib/cjs/InputTipField.js
CHANGED
|
@@ -13,6 +13,15 @@ const ListItem_1 = __importDefault(require("@mui/material/ListItem"));
|
|
|
13
13
|
const Popover_1 = __importDefault(require("@mui/material/Popover"));
|
|
14
14
|
const List_1 = __importDefault(require("@mui/material/List"));
|
|
15
15
|
const InputAdornment_1 = __importDefault(require("@mui/material/InputAdornment"));
|
|
16
|
+
const EmailInput_1 = require("./EmailInput");
|
|
17
|
+
const MobileInput_1 = require("./MobileInput");
|
|
18
|
+
const PhoneInput_1 = require("./PhoneInput");
|
|
19
|
+
const componentMap = {
|
|
20
|
+
input: InputField_1.InputField,
|
|
21
|
+
email: EmailInput_1.EmailInput,
|
|
22
|
+
phone: PhoneInput_1.PhoneInput,
|
|
23
|
+
mobile: MobileInput_1.MobileInput
|
|
24
|
+
};
|
|
16
25
|
/**
|
|
17
26
|
* InputField with tips
|
|
18
27
|
* @param props Props
|
|
@@ -26,11 +35,13 @@ function InputTipField(props) {
|
|
|
26
35
|
const [anchorEl, setAnchorEl] = react_1.default.useState();
|
|
27
36
|
const [data, setData] = react_1.default.useState();
|
|
28
37
|
// Destruct
|
|
38
|
+
const { component = "input", componentProps, changeDelay = 480, onChangeDelay, fullWidth = true, slotProps = {}, ...rest } = props;
|
|
29
39
|
const { labelProps = {
|
|
30
40
|
title: app?.get("clickForDetails"),
|
|
31
41
|
sx: { color: (theme) => theme.palette.error.main, cursor: "pointer" }
|
|
32
|
-
},
|
|
42
|
+
}, loadData, itemLabel = (item) => item.label, renderItem = (item) => (0, jsx_runtime_1.jsx)(ListItem_1.default, { children: itemLabel(item) }, item.id) } = componentProps;
|
|
33
43
|
const { input, ...slotRests } = slotProps;
|
|
44
|
+
const Component = componentMap[component];
|
|
34
45
|
const load = (value) => {
|
|
35
46
|
if (value.length < 2) {
|
|
36
47
|
setTitle(undefined);
|
|
@@ -44,7 +55,7 @@ function InputTipField(props) {
|
|
|
44
55
|
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Popover_1.default, { open: anchorEl != null, anchorEl: anchorEl, onClose: () => setAnchorEl(undefined), anchorOrigin: {
|
|
45
56
|
vertical: "bottom",
|
|
46
57
|
horizontal: "left"
|
|
47
|
-
}, children: data && (0, jsx_runtime_1.jsx)(List_1.default, { children: data.map((item) => renderItem(item)) }) }), (0, jsx_runtime_1.jsx)(
|
|
58
|
+
}, children: data && (0, jsx_runtime_1.jsx)(List_1.default, { children: data.map((item) => renderItem(item)) }) }), (0, jsx_runtime_1.jsx)(Component, { changeDelay: changeDelay, fullWidth: fullWidth, onChangeDelay: (event) => {
|
|
48
59
|
load(event.target.value);
|
|
49
60
|
if (onChangeDelay)
|
|
50
61
|
onChangeDelay(event);
|
|
@@ -52,4 +52,4 @@ export type IntInputFieldProps = Omit<InputFieldProps, "type" | "inputProps" | "
|
|
|
52
52
|
/**
|
|
53
53
|
* Integer input field (controlled)
|
|
54
54
|
*/
|
|
55
|
-
export declare
|
|
55
|
+
export declare function IntInputField(props: IntInputFieldProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/cjs/IntInputField.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.IntInputField =
|
|
6
|
+
exports.IntInputField = IntInputField;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
9
9
|
const Remove_1 = __importDefault(require("@mui/icons-material/Remove"));
|
|
@@ -16,7 +16,7 @@ const IconButton_1 = __importDefault(require("@mui/material/IconButton"));
|
|
|
16
16
|
/**
|
|
17
17
|
* Integer input field (controlled)
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
function IntInputField(props) {
|
|
20
20
|
// Destruct
|
|
21
21
|
const { min = 0, step = 1, max = 9999999, inputStyle = { textAlign: "right" }, boxProps, buttons, endSymbol, symbol, value, changeDelay = 600, onChangeDelay, onChange, onFocus = (event) => event.currentTarget.select(), onValueChange, required, ...rest } = props;
|
|
22
22
|
// State
|
|
@@ -43,15 +43,12 @@ exports.IntInputField = react_1.default.forwardRef((props, ref) => {
|
|
|
43
43
|
setValue(value, undefined, true);
|
|
44
44
|
}, [value]);
|
|
45
45
|
// Layout
|
|
46
|
-
const layout = ((0, jsx_runtime_1.jsx)(InputField_1.InputField, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
inputMode: "numeric"
|
|
52
|
-
}, InputProps: {
|
|
53
|
-
startAdornment: symbol ? ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(InputAdornment_1.default, { position: "start", children: symbol }) })) : undefined,
|
|
54
|
-
endAdornment: endSymbol ? ((0, jsx_runtime_1.jsx)(InputAdornment_1.default, { position: "end", children: endSymbol })) : undefined
|
|
46
|
+
const layout = ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { type: "number", value: localValue == null ? (required ? min : "") : localValue, slotProps: {
|
|
47
|
+
input: {
|
|
48
|
+
startAdornment: symbol ? ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(InputAdornment_1.default, { position: "start", children: symbol }) })) : undefined,
|
|
49
|
+
endAdornment: endSymbol ? ((0, jsx_runtime_1.jsx)(InputAdornment_1.default, { position: "end", children: endSymbol })) : undefined
|
|
50
|
+
},
|
|
51
|
+
htmlInput: { min, step, max, style: inputStyle, inputMode: "numeric" }
|
|
55
52
|
}, sx: buttons
|
|
56
53
|
? {
|
|
57
54
|
"& input[type=number]::-webkit-inner-spin-button": {
|
|
@@ -115,4 +112,4 @@ exports.IntInputField = react_1.default.forwardRef((props, ref) => {
|
|
|
115
112
|
}, children: (0, jsx_runtime_1.jsx)(Add_1.default, { color: localValue == null ? undefined : "primary" }) })] }));
|
|
116
113
|
else
|
|
117
114
|
return layout;
|
|
118
|
-
}
|
|
115
|
+
}
|
package/lib/cjs/MobileInput.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputFieldProps } from "./InputField";
|
|
2
2
|
/**
|
|
3
3
|
* Mobile input props
|
|
4
4
|
*/
|
|
5
|
-
export type MobileInputProps = Omit<
|
|
5
|
+
export type MobileInputProps = Omit<InputFieldProps, "type"> & {};
|
|
6
6
|
/**
|
|
7
7
|
* Mobile input
|
|
8
8
|
* @param props Props
|
package/lib/cjs/MobileInput.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.MobileInput = MobileInput;
|
|
7
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
9
5
|
const ReactApp_1 = require("./app/ReactApp");
|
|
10
6
|
const MUGlobal_1 = require("./MUGlobal");
|
|
7
|
+
const InputField_1 = require("./InputField");
|
|
11
8
|
/**
|
|
12
9
|
* Mobile input
|
|
13
10
|
* @param props Props
|
|
@@ -20,7 +17,7 @@ function MobileInput(props) {
|
|
|
20
17
|
// Slot props
|
|
21
18
|
const { htmlInput, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
22
19
|
// Layout
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
|
|
24
21
|
htmlInput: { inputMode: "tel", maxLength: 18, ...htmlInput },
|
|
25
22
|
inputLabel: { shrink: MUGlobal_1.MUGlobal.inputFieldShrink, ...inputLabel },
|
|
26
23
|
...restSlotProps
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { IntInputFieldProps } from "./IntInputField";
|
|
3
2
|
/**
|
|
4
3
|
* Money input field props
|
|
@@ -7,4 +6,4 @@ export type MoneyInputFieldProps = IntInputFieldProps & {};
|
|
|
7
6
|
/**
|
|
8
7
|
* Money input field (controlled)
|
|
9
8
|
*/
|
|
10
|
-
export declare
|
|
9
|
+
export declare function MoneyInputField(props: MoneyInputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MoneyInputField =
|
|
3
|
+
exports.MoneyInputField = MoneyInputField;
|
|
7
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
5
|
const IntInputField_1 = require("./IntInputField");
|
|
10
6
|
/**
|
|
11
7
|
* Money input field (controlled)
|
|
12
8
|
*/
|
|
13
|
-
|
|
9
|
+
function MoneyInputField(props) {
|
|
14
10
|
// Destruct
|
|
15
11
|
const { step = 0.01, ...rest } = props;
|
|
16
12
|
// Layout
|
|
17
|
-
return (0, jsx_runtime_1.jsx)(IntInputField_1.IntInputField, {
|
|
18
|
-
}
|
|
13
|
+
return (0, jsx_runtime_1.jsx)(IntInputField_1.IntInputField, { step: step, ...rest });
|
|
14
|
+
}
|
package/lib/cjs/PhoneInput.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputFieldProps } from "./InputField";
|
|
2
2
|
/**
|
|
3
3
|
* Phone input props
|
|
4
4
|
*/
|
|
5
|
-
export type PhoneInputProps = Omit<
|
|
5
|
+
export type PhoneInputProps = Omit<InputFieldProps, "type"> & {};
|
|
6
6
|
/**
|
|
7
7
|
* Phone input
|
|
8
8
|
* @param props Props
|
package/lib/cjs/PhoneInput.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.PhoneInput = PhoneInput;
|
|
7
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
9
5
|
const ReactApp_1 = require("./app/ReactApp");
|
|
10
6
|
const MUGlobal_1 = require("./MUGlobal");
|
|
7
|
+
const InputField_1 = require("./InputField");
|
|
11
8
|
/**
|
|
12
9
|
* Phone input
|
|
13
10
|
* @param props Props
|
|
@@ -20,7 +17,7 @@ function PhoneInput(props) {
|
|
|
20
17
|
// Slot props
|
|
21
18
|
const { htmlInput, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
22
19
|
// Layout
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
|
|
24
21
|
htmlInput: { inputMode: "tel", maxLength: 18, ...htmlInput },
|
|
25
22
|
inputLabel: { shrink: MUGlobal_1.MUGlobal.inputFieldShrink, ...inputLabel },
|
|
26
23
|
...restSlotProps
|
package/lib/cjs/TextFieldEx.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ export type TextFieldExProps = TextFieldProps & {
|
|
|
38
38
|
* Show password button
|
|
39
39
|
*/
|
|
40
40
|
showPassword?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Methods
|
|
43
|
+
*/
|
|
44
|
+
mRef?: React.Ref<TextFieldExMethods>;
|
|
41
45
|
};
|
|
42
46
|
/**
|
|
43
47
|
* Extended text field methods
|
|
@@ -49,109 +53,4 @@ export interface TextFieldExMethods {
|
|
|
49
53
|
*/
|
|
50
54
|
setError(error: React.ReactNode): void;
|
|
51
55
|
}
|
|
52
|
-
export declare
|
|
53
|
-
/**
|
|
54
|
-
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
55
|
-
*/
|
|
56
|
-
changeDelay?: number;
|
|
57
|
-
/**
|
|
58
|
-
* Clear button label
|
|
59
|
-
*/
|
|
60
|
-
clearLabel?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Click clear button callback
|
|
63
|
-
*/
|
|
64
|
-
onClear?: (doClear: () => void) => void;
|
|
65
|
-
/**
|
|
66
|
-
* On enter click
|
|
67
|
-
*/
|
|
68
|
-
onEnter?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
69
|
-
/**
|
|
70
|
-
* On visibility
|
|
71
|
-
* @param input HTML input
|
|
72
|
-
* @returns Result
|
|
73
|
-
*/
|
|
74
|
-
onVisibility?: (input: HTMLInputElement) => void | boolean | Promise<boolean>;
|
|
75
|
-
/**
|
|
76
|
-
* Is the field read only?
|
|
77
|
-
*/
|
|
78
|
-
readOnly?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Show clear button
|
|
81
|
-
*/
|
|
82
|
-
showClear?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Show password button
|
|
85
|
-
*/
|
|
86
|
-
showPassword?: boolean;
|
|
87
|
-
}, "ref"> | Omit<import("@mui/material/TextField").OutlinedTextFieldProps & {
|
|
88
|
-
/**
|
|
89
|
-
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
90
|
-
*/
|
|
91
|
-
changeDelay?: number;
|
|
92
|
-
/**
|
|
93
|
-
* Clear button label
|
|
94
|
-
*/
|
|
95
|
-
clearLabel?: string;
|
|
96
|
-
/**
|
|
97
|
-
* Click clear button callback
|
|
98
|
-
*/
|
|
99
|
-
onClear?: (doClear: () => void) => void;
|
|
100
|
-
/**
|
|
101
|
-
* On enter click
|
|
102
|
-
*/
|
|
103
|
-
onEnter?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
104
|
-
/**
|
|
105
|
-
* On visibility
|
|
106
|
-
* @param input HTML input
|
|
107
|
-
* @returns Result
|
|
108
|
-
*/
|
|
109
|
-
onVisibility?: (input: HTMLInputElement) => void | boolean | Promise<boolean>;
|
|
110
|
-
/**
|
|
111
|
-
* Is the field read only?
|
|
112
|
-
*/
|
|
113
|
-
readOnly?: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Show clear button
|
|
116
|
-
*/
|
|
117
|
-
showClear?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Show password button
|
|
120
|
-
*/
|
|
121
|
-
showPassword?: boolean;
|
|
122
|
-
}, "ref"> | Omit<import("@mui/material/TextField").FilledTextFieldProps & {
|
|
123
|
-
/**
|
|
124
|
-
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
125
|
-
*/
|
|
126
|
-
changeDelay?: number;
|
|
127
|
-
/**
|
|
128
|
-
* Clear button label
|
|
129
|
-
*/
|
|
130
|
-
clearLabel?: string;
|
|
131
|
-
/**
|
|
132
|
-
* Click clear button callback
|
|
133
|
-
*/
|
|
134
|
-
onClear?: (doClear: () => void) => void;
|
|
135
|
-
/**
|
|
136
|
-
* On enter click
|
|
137
|
-
*/
|
|
138
|
-
onEnter?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
139
|
-
/**
|
|
140
|
-
* On visibility
|
|
141
|
-
* @param input HTML input
|
|
142
|
-
* @returns Result
|
|
143
|
-
*/
|
|
144
|
-
onVisibility?: (input: HTMLInputElement) => void | boolean | Promise<boolean>;
|
|
145
|
-
/**
|
|
146
|
-
* Is the field read only?
|
|
147
|
-
*/
|
|
148
|
-
readOnly?: boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Show clear button
|
|
151
|
-
*/
|
|
152
|
-
showClear?: boolean;
|
|
153
|
-
/**
|
|
154
|
-
* Show password button
|
|
155
|
-
*/
|
|
156
|
-
showPassword?: boolean;
|
|
157
|
-
}, "ref">) & React.RefAttributes<TextFieldExMethods>>;
|
|
56
|
+
export declare function TextFieldEx(props: TextFieldExProps): import("react/jsx-runtime").JSX.Element;
|