@etsoo/materialui 1.3.6 → 1.3.7

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.
@@ -9,7 +9,7 @@ import { InputField } from "./InputField";
9
9
  */
10
10
  export const IntInputField = React.forwardRef((props, ref) => {
11
11
  // Destruct
12
- const { min = 0, step = 1, max = 9999999, inputStyle = { textAlign: "right" }, boxProps, buttons, endSymbol, symbol, value, changeDelay = 600, onChangeDelay, onChange, onValueChange, required, ...rest } = props;
12
+ 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;
13
13
  // State
14
14
  const [localValue, setLocalValue] = React.useState();
15
15
  const setValue = (value, source, init = false) => {
@@ -74,7 +74,7 @@ export const IntInputField = React.forwardRef((props, ref) => {
74
74
  setValue(value, source);
75
75
  if (onChangeDelay)
76
76
  onChangeDelay(event);
77
- }, required: required, ...rest }));
77
+ }, onFocus: onFocus, required: required, ...rest }));
78
78
  if (buttons)
79
79
  return (React.createElement(Box, { sx: {
80
80
  display: "flex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -91,6 +91,7 @@ export const IntInputField = React.forwardRef<
91
91
  changeDelay = 600,
92
92
  onChangeDelay,
93
93
  onChange,
94
+ onFocus = (event) => event.currentTarget.select(),
94
95
  onValueChange,
95
96
  required,
96
97
  ...rest
@@ -179,6 +180,7 @@ export const IntInputField = React.forwardRef<
179
180
 
180
181
  if (onChangeDelay) onChangeDelay(event);
181
182
  }}
183
+ onFocus={onFocus}
182
184
  required={required}
183
185
  {...rest}
184
186
  />