@mintjamsinc/ichigojs 0.1.56 → 0.1.57
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/ichigo.cjs +19 -15
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +19 -15
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.min.cjs +1 -1
- package/dist/ichigo.umd.js +19 -15
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/ichigo.esm.js
CHANGED
|
@@ -11393,23 +11393,27 @@ class VOnDirective {
|
|
|
11393
11393
|
this.#listener = (event) => {
|
|
11394
11394
|
// Check key modifiers for keyboard events
|
|
11395
11395
|
if (event instanceof KeyboardEvent) {
|
|
11396
|
-
|
|
11397
|
-
|
|
11396
|
+
// Map of modifier alias -> KeyboardEvent.key values it matches.
|
|
11397
|
+
// Multiple values allow a single modifier to match several physical keys
|
|
11398
|
+
// (e.g. `.delete` matches both Delete and Backspace, matching Vue's behavior).
|
|
11399
|
+
// Multiple aliases pointing to the same key are allowed (e.g. `.esc` / `.escape`).
|
|
11400
|
+
const keyMap = {
|
|
11401
|
+
'enter': ['Enter'],
|
|
11402
|
+
'tab': ['Tab'],
|
|
11403
|
+
'delete': ['Delete', 'Backspace'],
|
|
11404
|
+
'esc': ['Escape'],
|
|
11405
|
+
'escape': ['Escape'],
|
|
11406
|
+
'space': [' '],
|
|
11407
|
+
'up': ['ArrowUp'],
|
|
11408
|
+
'down': ['ArrowDown'],
|
|
11409
|
+
'left': ['ArrowLeft'],
|
|
11410
|
+
'right': ['ArrowRight']
|
|
11411
|
+
};
|
|
11412
|
+
const hasKeyModifier = Object.keys(keyMap).some(key => this.#modifiers.has(key));
|
|
11398
11413
|
if (hasKeyModifier) {
|
|
11399
|
-
const keyMap = {
|
|
11400
|
-
'enter': 'Enter',
|
|
11401
|
-
'tab': 'Tab',
|
|
11402
|
-
'delete': 'Delete',
|
|
11403
|
-
'esc': 'Escape',
|
|
11404
|
-
'space': ' ',
|
|
11405
|
-
'up': 'ArrowUp',
|
|
11406
|
-
'down': 'ArrowDown',
|
|
11407
|
-
'left': 'ArrowLeft',
|
|
11408
|
-
'right': 'ArrowRight'
|
|
11409
|
-
};
|
|
11410
11414
|
let keyMatched = false;
|
|
11411
|
-
for (const [modifier,
|
|
11412
|
-
if (this.#modifiers.has(modifier) && event.key
|
|
11415
|
+
for (const [modifier, keyValues] of Object.entries(keyMap)) {
|
|
11416
|
+
if (this.#modifiers.has(modifier) && keyValues.includes(event.key)) {
|
|
11413
11417
|
keyMatched = true;
|
|
11414
11418
|
break;
|
|
11415
11419
|
}
|