@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.
package/dist/index.js CHANGED
@@ -1436,8 +1436,24 @@ const th = {
1436
1436
  },
1437
1437
  };
1438
1438
 
1439
- function Input({ className, type, ...props }) {
1440
- return (require$$1.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 }));
1439
+ function Input({ className, type, onWheel, ...props }) {
1440
+ // Scrolling the page with the pointer over a FOCUSED number input makes the
1441
+ // browser step its value — the user is just moving down the form and the
1442
+ // quantity or price they typed silently changes under the cursor. Blink only
1443
+ // does this for discrete wheel notches, so a mouse (Windows, typically) hits
1444
+ // it constantly while a trackpad (macOS) almost never does, which is why it
1445
+ // reads as a platform bug.
1446
+ //
1447
+ // Blurring drops the focus the stepping depends on, so the wheel goes back to
1448
+ // scrolling the page. preventDefault() is not an option: React attaches wheel
1449
+ // listeners passively, and blocking it would trap the page under the cursor.
1450
+ const handleWheel = (event) => {
1451
+ onWheel?.(event);
1452
+ if (type === "number" && document.activeElement === event.currentTarget) {
1453
+ event.currentTarget.blur();
1454
+ }
1455
+ };
1456
+ return (require$$1.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 }));
1441
1457
  }
1442
1458
 
1443
1459
  function Popover({ ...props }) {