@eintrek/erp-theme 1.4.12 → 1.4.13

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.
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
- declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
2
+ declare function Input({ className, type, onWheel, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
3
3
  export { Input };
package/dist/index.esm.js CHANGED
@@ -1391,8 +1391,24 @@ const th = {
1391
1391
  },
1392
1392
  };
1393
1393
 
1394
- function Input({ className, type, ...props }) {
1395
- return (jsx("input", { type: type, "data-slot": "input", className: cn$1("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className), ...props }));
1394
+ function Input({ className, type, onWheel, ...props }) {
1395
+ // Scrolling the page with the pointer over a FOCUSED number input makes the
1396
+ // browser step its value — the user is just moving down the form and the
1397
+ // quantity or price they typed silently changes under the cursor. Blink only
1398
+ // does this for discrete wheel notches, so a mouse (Windows, typically) hits
1399
+ // it constantly while a trackpad (macOS) almost never does, which is why it
1400
+ // reads as a platform bug.
1401
+ //
1402
+ // Blurring drops the focus the stepping depends on, so the wheel goes back to
1403
+ // scrolling the page. preventDefault() is not an option: React attaches wheel
1404
+ // listeners passively, and blocking it would trap the page under the cursor.
1405
+ const handleWheel = (event) => {
1406
+ onWheel?.(event);
1407
+ if (type === "number" && document.activeElement === event.currentTarget) {
1408
+ event.currentTarget.blur();
1409
+ }
1410
+ };
1411
+ return (jsx("input", { type: type, onWheel: handleWheel, "data-slot": "input", className: cn$1("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className), ...props }));
1396
1412
  }
1397
1413
 
1398
1414
  function Popover({ ...props }) {