@etsoo/materialui 1.4.41 → 1.4.42

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/InputField.js CHANGED
@@ -10,12 +10,14 @@ import { MUGlobal } from "./MUGlobal";
10
10
  */
11
11
  export const InputField = React.forwardRef((props, ref) => {
12
12
  // Destruct
13
- const { changeDelay, InputLabelProps = {}, InputProps = {}, onChange, onChangeDelay, readOnly, size = MUGlobal.inputFieldSize, variant = MUGlobal.inputFieldVariant, minChars = 0, ...rest } = props;
13
+ const { changeDelay, InputLabelProps = {}, InputProps = {}, inputProps = {}, onChange, onChangeDelay, readOnly, size = MUGlobal.inputFieldSize, variant = MUGlobal.inputFieldVariant, minChars = 0, ...rest } = props;
14
14
  // Shrink
15
15
  InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
16
16
  // Read only
17
17
  if (readOnly != null)
18
18
  InputProps.readOnly = readOnly;
19
+ // Min characters
20
+ inputProps["data-min-chars"] = minChars;
19
21
  const isMounted = React.useRef(true);
20
22
  const createDelayed = () => {
21
23
  if (changeDelay != null && changeDelay >= 1) {
@@ -42,5 +44,5 @@ export const InputField = React.forwardRef((props, ref) => {
42
44
  };
43
45
  }, []);
44
46
  // Layout
45
- return (_jsx(TextField, { ref: ref, InputLabelProps: InputLabelProps, InputProps: InputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
47
+ return (_jsx(TextField, { ref: ref, InputLabelProps: InputLabelProps, InputProps: InputProps, inputProps: inputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
46
48
  });
@@ -10,12 +10,14 @@ import { MUGlobal } from "./MUGlobal";
10
10
  */
11
11
  export function SearchField(props) {
12
12
  // Destruct
13
- const { changeDelay, InputLabelProps = {}, InputProps = {}, onChange, readOnly, size = MUGlobal.searchFieldSize, variant = MUGlobal.searchFieldVariant, minChars = 0, ...rest } = props;
13
+ const { changeDelay, InputLabelProps = {}, InputProps = {}, inputProps = {}, onChange, readOnly, size = MUGlobal.searchFieldSize, variant = MUGlobal.searchFieldVariant, minChars = 0, ...rest } = props;
14
14
  // Shrink
15
15
  InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
16
16
  // Read only
17
17
  if (readOnly != null)
18
18
  InputProps.readOnly = readOnly;
19
+ // Min characters
20
+ inputProps["data-min-chars"] = minChars;
19
21
  const isMounted = React.useRef(true);
20
22
  const delayed = onChange != null && changeDelay != null && changeDelay >= 1
21
23
  ? useDelayedExecutor(onChange, changeDelay)
@@ -40,5 +42,5 @@ export function SearchField(props) {
40
42
  };
41
43
  }, []);
42
44
  // Layout
43
- return (_jsx(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
45
+ return (_jsx(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, inputProps: inputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
44
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.4.41",
3
+ "version": "1.4.42",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -42,6 +42,7 @@ export const InputField = React.forwardRef<HTMLDivElement, InputFieldProps>(
42
42
  changeDelay,
43
43
  InputLabelProps = {},
44
44
  InputProps = {},
45
+ inputProps = {},
45
46
  onChange,
46
47
  onChangeDelay,
47
48
  readOnly,
@@ -57,6 +58,9 @@ export const InputField = React.forwardRef<HTMLDivElement, InputFieldProps>(
57
58
  // Read only
58
59
  if (readOnly != null) InputProps.readOnly = readOnly;
59
60
 
61
+ // Min characters
62
+ inputProps["data-min-chars"] = minChars;
63
+
60
64
  const isMounted = React.useRef(true);
61
65
  const createDelayed = () => {
62
66
  if (changeDelay != null && changeDelay >= 1) {
@@ -93,6 +97,7 @@ export const InputField = React.forwardRef<HTMLDivElement, InputFieldProps>(
93
97
  ref={ref}
94
98
  InputLabelProps={InputLabelProps}
95
99
  InputProps={InputProps}
100
+ inputProps={inputProps}
96
101
  onChange={onChangeEx}
97
102
  size={size}
98
103
  variant={variant}
@@ -34,6 +34,7 @@ export function SearchField(props: SearchFieldProps) {
34
34
  changeDelay,
35
35
  InputLabelProps = {},
36
36
  InputProps = {},
37
+ inputProps = {},
37
38
  onChange,
38
39
  readOnly,
39
40
  size = MUGlobal.searchFieldSize,
@@ -48,6 +49,9 @@ export function SearchField(props: SearchFieldProps) {
48
49
  // Read only
49
50
  if (readOnly != null) InputProps.readOnly = readOnly;
50
51
 
52
+ // Min characters
53
+ inputProps["data-min-chars"] = minChars;
54
+
51
55
  const isMounted = React.useRef(true);
52
56
  const delayed =
53
57
  onChange != null && changeDelay != null && changeDelay >= 1
@@ -83,6 +87,7 @@ export function SearchField(props: SearchFieldProps) {
83
87
  <TextField
84
88
  InputLabelProps={InputLabelProps}
85
89
  InputProps={InputProps}
90
+ inputProps={inputProps}
86
91
  onChange={onChangeEx}
87
92
  size={size}
88
93
  variant={variant}