feat: support pasting numbers into the calculator stack

Add clipboard paste handling for the hidden input and the paste button so pasted text is parsed as a numeric value before being pushed. Also add the eˣ function key in the sample calculator and keep the hidden input selected on focus for Ctrl+V support.
This commit is contained in:
2026-05-15 20:45:30 +02:00
parent 02b3b280f8
commit d1a1d44577
2 changed files with 45 additions and 21 deletions
+1
View File
@@ -5,4 +5,5 @@
- Public API: `push`, `pop`, `clear`, `swap`, `remove`, `edit`, `isValidIndex`, `input`, `command`, `getOperationsByCategory`, `getConstants`
- Config: `maxSize`, `base`, `angleMode`, `enabledCommands`
- Commands: arithmetic, stack, trigonometry, constants `pi` and `e`
- Demo actions: paste now parses clipboard text as a number before pushing it to the stack; Ctrl+V is supported via the hidden input paste event
- Exports: browser `window.RpnCalculator`, CommonJS `module.exports`