@mintjamsinc/ichigojs 0.1.56 → 0.1.58

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.
@@ -8647,6 +8647,14 @@ class VDirectiveManager {
8647
8647
  // Other directives (@click, :class, etc.) will be processed on the cloned/rendered elements.
8648
8648
  const attributes = [];
8649
8649
  if (element.hasAttribute(StandardDirectiveName.V_FOR)) {
8650
+ // <template v-for v-if> is not supported: v-for clones .content (a
8651
+ // DocumentFragment), so the v-if attribute on the <template> itself
8652
+ // is lost. Warn the developer so silent failure is avoided.
8653
+ if (element instanceof HTMLTemplateElement && element.hasAttribute(StandardDirectiveName.V_IF)) {
8654
+ console.warn('[ichigo.js] <template> cannot combine v-for and v-if. ' +
8655
+ 'The v-if will be ignored. Move v-if to an inner element, ' +
8656
+ 'or replace <template> with a regular element.', element);
8657
+ }
8650
8658
  // For v-for template element: only process v-for and :key
8651
8659
  // Other attributes will be processed when child VNodes are created for cloned elements
8652
8660
  attributes.push(element.getAttributeNode(StandardDirectiveName.V_FOR));
@@ -11393,23 +11401,27 @@ class VOnDirective {
11393
11401
  this.#listener = (event) => {
11394
11402
  // Check key modifiers for keyboard events
11395
11403
  if (event instanceof KeyboardEvent) {
11396
- const keyModifiers = ['enter', 'tab', 'delete', 'esc', 'space', 'up', 'down', 'left', 'right'];
11397
- const hasKeyModifier = keyModifiers.some(key => this.#modifiers.has(key));
11404
+ // Map of modifier alias -> KeyboardEvent.key values it matches.
11405
+ // Multiple values allow a single modifier to match several physical keys
11406
+ // (e.g. `.delete` matches both Delete and Backspace, matching Vue's behavior).
11407
+ // Multiple aliases pointing to the same key are allowed (e.g. `.esc` / `.escape`).
11408
+ const keyMap = {
11409
+ 'enter': ['Enter'],
11410
+ 'tab': ['Tab'],
11411
+ 'delete': ['Delete', 'Backspace'],
11412
+ 'esc': ['Escape'],
11413
+ 'escape': ['Escape'],
11414
+ 'space': [' '],
11415
+ 'up': ['ArrowUp'],
11416
+ 'down': ['ArrowDown'],
11417
+ 'left': ['ArrowLeft'],
11418
+ 'right': ['ArrowRight']
11419
+ };
11420
+ const hasKeyModifier = Object.keys(keyMap).some(key => this.#modifiers.has(key));
11398
11421
  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
11422
  let keyMatched = false;
11411
- for (const [modifier, keyValue] of Object.entries(keyMap)) {
11412
- if (this.#modifiers.has(modifier) && event.key === keyValue) {
11423
+ for (const [modifier, keyValues] of Object.entries(keyMap)) {
11424
+ if (this.#modifiers.has(modifier) && keyValues.includes(event.key)) {
11413
11425
  keyMatched = true;
11414
11426
  break;
11415
11427
  }