myoperator-mcp 0.2.246 → 0.2.248
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/dist/index.js +34 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2943,6 +2943,8 @@ import { Check } from "lucide-react";
|
|
|
2943
2943
|
|
|
2944
2944
|
import { cn } from "@/lib/utils";
|
|
2945
2945
|
|
|
2946
|
+
const blockedNumberKeys = new Set(["e", "E"]);
|
|
2947
|
+
|
|
2946
2948
|
/**
|
|
2947
2949
|
* Input variants for different visual states
|
|
2948
2950
|
*/
|
|
@@ -2985,6 +2987,11 @@ export interface InputProps
|
|
|
2985
2987
|
* Set \`false\` to show native increment/decrement controls (e.g. delay fields).
|
|
2986
2988
|
*/
|
|
2987
2989
|
hideNumberSpinners?: boolean;
|
|
2990
|
+
/**
|
|
2991
|
+
* When \`type="number"\`, prevent scientific notation characters (\`e\`/\`E\`).
|
|
2992
|
+
* Default \`true\` so amount-like fields cannot accept exponent values such as \`2e22\`.
|
|
2993
|
+
*/
|
|
2994
|
+
preventNumberExponent?: boolean;
|
|
2988
2995
|
}
|
|
2989
2996
|
|
|
2990
2997
|
const Input = React.forwardRef(
|
|
@@ -2995,14 +3002,20 @@ const Input = React.forwardRef(
|
|
|
2995
3002
|
type,
|
|
2996
3003
|
showCheckIcon,
|
|
2997
3004
|
hideNumberSpinners = true,
|
|
3005
|
+
preventNumberExponent = true,
|
|
2998
3006
|
onFocus,
|
|
2999
3007
|
onBlur,
|
|
3000
3008
|
onWheel,
|
|
3009
|
+
onKeyDown,
|
|
3010
|
+
onPaste,
|
|
3011
|
+
onChange,
|
|
3001
3012
|
...props
|
|
3002
3013
|
}: InputProps,
|
|
3003
3014
|
ref: React.Ref<HTMLInputElement>
|
|
3004
3015
|
) => {
|
|
3005
3016
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
3017
|
+
const shouldPreventNumberExponent =
|
|
3018
|
+
type === "number" && preventNumberExponent;
|
|
3006
3019
|
|
|
3007
3020
|
const inputEl = (
|
|
3008
3021
|
<input
|
|
@@ -3031,6 +3044,27 @@ const Input = React.forwardRef(
|
|
|
3031
3044
|
}
|
|
3032
3045
|
: onWheel
|
|
3033
3046
|
}
|
|
3047
|
+
onKeyDown={(e) => {
|
|
3048
|
+
if (shouldPreventNumberExponent && blockedNumberKeys.has(e.key)) {
|
|
3049
|
+
e.preventDefault();
|
|
3050
|
+
}
|
|
3051
|
+
onKeyDown?.(e);
|
|
3052
|
+
}}
|
|
3053
|
+
onPaste={(e) => {
|
|
3054
|
+
if (
|
|
3055
|
+
shouldPreventNumberExponent &&
|
|
3056
|
+
/[eE]/.test(e.clipboardData.getData("text"))
|
|
3057
|
+
) {
|
|
3058
|
+
e.preventDefault();
|
|
3059
|
+
}
|
|
3060
|
+
onPaste?.(e);
|
|
3061
|
+
}}
|
|
3062
|
+
onChange={(e) => {
|
|
3063
|
+
if (shouldPreventNumberExponent && /[eE]/.test(e.target.value)) {
|
|
3064
|
+
return;
|
|
3065
|
+
}
|
|
3066
|
+
onChange?.(e);
|
|
3067
|
+
}}
|
|
3034
3068
|
{...props}
|
|
3035
3069
|
/>
|
|
3036
3070
|
);
|
package/package.json
CHANGED