@progress/kendo-angular-menu 19.3.0-develop.31 → 19.3.0-develop.33

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.
@@ -235,7 +235,7 @@ export class ContextMenuComponent extends MenuBase {
235
235
  });
236
236
  if (eventName === CONTEXT_MENU) {
237
237
  this.keydownSubscription = this.renderer.listen(element, 'keydown', (e) => {
238
- if (e.shiftKey && e.keyCode === Keys.F10) {
238
+ if (e.shiftKey && e.code === Keys.F10) {
239
239
  this.showContextMenu(e, element);
240
240
  }
241
241
  });
@@ -368,7 +368,7 @@ export class ContextMenuComponent extends MenuBase {
368
368
  }
369
369
  popupKeyDownHandler(e) {
370
370
  const element = this.popupRef.popupElement;
371
- if (e.keyCode === Keys.Escape && (hasClass(e.target, 'k-menu-item') || e.target === element)) {
371
+ if (e.code === Keys.Escape && (hasClass(e.target, 'k-menu-item') || e.target === element)) {
372
372
  this.closeAndFocus(e);
373
373
  }
374
374
  else if (e.target === element) {
@@ -15,7 +15,7 @@ import { normalize } from './open-on-click-settings';
15
15
  import { inMenu } from './dom-queries';
16
16
  import { ContextMenuService } from './context-menu/context-menu.service';
17
17
  import { MenuBase } from './menu-base';
18
- import { Keys, isDocumentAvailable } from '@progress/kendo-angular-common';
18
+ import { Keys, isDocumentAvailable, normalizeNumpadKeys } from '@progress/kendo-angular-common';
19
19
  import { getSizeClass } from './utils';
20
20
  import { ListComponent } from './rendering/list.component';
21
21
  import * as i0 from "@angular/core";
@@ -203,7 +203,7 @@ export class MenuComponent extends MenuBase {
203
203
  if (!this.itemsService.hasItems) {
204
204
  return;
205
205
  }
206
- const keyCode = e.keyCode;
206
+ const keyCode = normalizeNumpadKeys(e);
207
207
  const rtl = this.localization.rtl;
208
208
  const first = keyCode === Keys.ArrowDown || keyCode === Keys.ArrowRight;
209
209
  const last = keyCode === Keys.ArrowUp || keyCode === Keys.ArrowLeft;
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1754576640,
14
- version: '19.3.0-develop.31',
13
+ publishDate: 1754589779,
14
+ version: '19.3.0-develop.33',
15
15
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
16
16
  };
@@ -6,6 +6,7 @@ import { Injectable, NgZone } from '@angular/core';
6
6
  import { LocalizationService } from '@progress/kendo-angular-l10n';
7
7
  import { ItemsService } from './items.service';
8
8
  import { ActionsService } from './actions.service';
9
+ import { Keys, normalizeNumpadKeys } from '@progress/kendo-angular-common';
9
10
  import * as i0 from "@angular/core";
10
11
  import * as i1 from "./items.service";
11
12
  import * as i2 from "./actions.service";
@@ -13,19 +14,21 @@ import * as i3 from "@progress/kendo-angular-l10n";
13
14
  const DEFAULT_ACTIVE = '0';
14
15
  const NO_SPACE_REGEX = /\S/;
15
16
  const handlers = {};
16
- handlers['37'] = 'left';
17
- handlers['39'] = 'right';
18
- handlers['38'] = 'up';
19
- handlers['40'] = 'down';
20
- handlers['36'] = 'home';
21
- handlers['35'] = 'end';
22
- handlers['32'] = 'enter';
23
- handlers['13'] = 'enter';
24
- handlers['27'] = 'esc';
25
- handlers['9'] = 'tab';
17
+ handlers[Keys.ArrowLeft] = 'left';
18
+ handlers[Keys.ArrowRight] = 'right';
19
+ handlers[Keys.ArrowUp] = 'up';
20
+ handlers[Keys.ArrowDown] = 'down';
21
+ handlers[Keys.Home] = 'home';
22
+ handlers[Keys.End] = 'end';
23
+ handlers[Keys.Space] = 'enter';
24
+ handlers[Keys.Enter] = 'enter';
25
+ handlers[Keys.NumpadEnter] = 'enter';
26
+ handlers[Keys.KeyN] = 'enter';
27
+ handlers[Keys.Escape] = 'esc';
28
+ handlers[Keys.Tab] = 'tab';
26
29
  const handlersRTL = Object.assign({}, handlers, {
27
- '37': 'right',
28
- '39': 'left'
30
+ 'ArrowLeft': 'right',
31
+ 'ArrowRight': 'left'
29
32
  });
30
33
  function isPrintableCharacter(key) {
31
34
  return key.length === 1 && NO_SPACE_REGEX.test(key);
@@ -91,10 +94,11 @@ export class NavigationService {
91
94
  }
92
95
  keydown(e) {
93
96
  const current = this.focusedItem || this.activeItem;
94
- const handler = this.handlers[e.keyCode];
95
97
  if (!current) {
96
98
  return;
97
99
  }
100
+ const code = normalizeNumpadKeys(e);
101
+ const handler = this.handlers[code];
98
102
  if (handler) {
99
103
  if (handler !== 'tab') {
100
104
  e.preventDefault();
@@ -8,7 +8,7 @@ import { NgFor, NgIf, NgClass, NgStyle, NgTemplateOutlet } from '@angular/common
8
8
  import * as i3 from '@progress/kendo-angular-l10n';
9
9
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
10
10
  import { validatePackage } from '@progress/kendo-licensing';
11
- import { PreventableEvent as PreventableEvent$1, hasObservers, isDocumentAvailable, Keys, ResizeBatchService } from '@progress/kendo-angular-common';
11
+ import { PreventableEvent as PreventableEvent$1, hasObservers, Keys, normalizeNumpadKeys, isDocumentAvailable, ResizeBatchService } from '@progress/kendo-angular-common';
12
12
  import { caretAltLeftIcon, caretAltRightIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';
13
13
  import * as i5 from '@progress/kendo-angular-popup';
14
14
  import { PopupService, POPUP_CONTAINER } from '@progress/kendo-angular-popup';
@@ -22,8 +22,8 @@ const packageMetadata = {
22
22
  productName: 'Kendo UI for Angular',
23
23
  productCode: 'KENDOUIANGULAR',
24
24
  productCodes: ['KENDOUIANGULAR'],
25
- publishDate: 1754576640,
26
- version: '19.3.0-develop.31',
25
+ publishDate: 1754589779,
26
+ version: '19.3.0-develop.33',
27
27
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
28
28
  };
29
29
 
@@ -337,19 +337,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
337
337
  const DEFAULT_ACTIVE = '0';
338
338
  const NO_SPACE_REGEX = /\S/;
339
339
  const handlers = {};
340
- handlers['37'] = 'left';
341
- handlers['39'] = 'right';
342
- handlers['38'] = 'up';
343
- handlers['40'] = 'down';
344
- handlers['36'] = 'home';
345
- handlers['35'] = 'end';
346
- handlers['32'] = 'enter';
347
- handlers['13'] = 'enter';
348
- handlers['27'] = 'esc';
349
- handlers['9'] = 'tab';
340
+ handlers[Keys.ArrowLeft] = 'left';
341
+ handlers[Keys.ArrowRight] = 'right';
342
+ handlers[Keys.ArrowUp] = 'up';
343
+ handlers[Keys.ArrowDown] = 'down';
344
+ handlers[Keys.Home] = 'home';
345
+ handlers[Keys.End] = 'end';
346
+ handlers[Keys.Space] = 'enter';
347
+ handlers[Keys.Enter] = 'enter';
348
+ handlers[Keys.NumpadEnter] = 'enter';
349
+ handlers[Keys.KeyN] = 'enter';
350
+ handlers[Keys.Escape] = 'esc';
351
+ handlers[Keys.Tab] = 'tab';
350
352
  const handlersRTL = Object.assign({}, handlers, {
351
- '37': 'right',
352
- '39': 'left'
353
+ 'ArrowLeft': 'right',
354
+ 'ArrowRight': 'left'
353
355
  });
354
356
  function isPrintableCharacter(key) {
355
357
  return key.length === 1 && NO_SPACE_REGEX.test(key);
@@ -415,10 +417,11 @@ class NavigationService {
415
417
  }
416
418
  keydown(e) {
417
419
  const current = this.focusedItem || this.activeItem;
418
- const handler = this.handlers[e.keyCode];
419
420
  if (!current) {
420
421
  return;
421
422
  }
423
+ const code = normalizeNumpadKeys(e);
424
+ const handler = this.handlers[code];
422
425
  if (handler) {
423
426
  if (handler !== 'tab') {
424
427
  e.preventDefault();
@@ -2105,7 +2108,7 @@ class MenuComponent extends MenuBase {
2105
2108
  if (!this.itemsService.hasItems) {
2106
2109
  return;
2107
2110
  }
2108
- const keyCode = e.keyCode;
2111
+ const keyCode = normalizeNumpadKeys(e);
2109
2112
  const rtl = this.localization.rtl;
2110
2113
  const first = keyCode === Keys.ArrowDown || keyCode === Keys.ArrowRight;
2111
2114
  const last = keyCode === Keys.ArrowUp || keyCode === Keys.ArrowLeft;
@@ -3109,7 +3112,7 @@ class ContextMenuComponent extends MenuBase {
3109
3112
  });
3110
3113
  if (eventName === CONTEXT_MENU) {
3111
3114
  this.keydownSubscription = this.renderer.listen(element, 'keydown', (e) => {
3112
- if (e.shiftKey && e.keyCode === Keys.F10) {
3115
+ if (e.shiftKey && e.code === Keys.F10) {
3113
3116
  this.showContextMenu(e, element);
3114
3117
  }
3115
3118
  });
@@ -3242,7 +3245,7 @@ class ContextMenuComponent extends MenuBase {
3242
3245
  }
3243
3246
  popupKeyDownHandler(e) {
3244
3247
  const element = this.popupRef.popupElement;
3245
- if (e.keyCode === Keys.Escape && (hasClass(e.target, 'k-menu-item') || e.target === element)) {
3248
+ if (e.code === Keys.Escape && (hasClass(e.target, 'k-menu-item') || e.target === element)) {
3246
3249
  this.closeAndFocus(e);
3247
3250
  }
3248
3251
  else if (e.target === element) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-menu",
3
- "version": "19.3.0-develop.31",
3
+ "version": "19.3.0-develop.33",
4
4
  "description": "Kendo UI Angular Menu component",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -19,7 +19,7 @@
19
19
  "package": {
20
20
  "productName": "Kendo UI for Angular",
21
21
  "productCode": "KENDOUIANGULAR",
22
- "publishDate": 1754576640,
22
+ "publishDate": 1754589779,
23
23
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
24
24
  }
25
25
  },
@@ -29,15 +29,15 @@
29
29
  "@angular/core": "16 - 20",
30
30
  "@angular/platform-browser": "16 - 20",
31
31
  "@progress/kendo-licensing": "^1.7.0",
32
- "@progress/kendo-angular-common": "19.3.0-develop.31",
33
- "@progress/kendo-angular-l10n": "19.3.0-develop.31",
34
- "@progress/kendo-angular-icons": "19.3.0-develop.31",
35
- "@progress/kendo-angular-popup": "19.3.0-develop.31",
32
+ "@progress/kendo-angular-common": "19.3.0-develop.33",
33
+ "@progress/kendo-angular-l10n": "19.3.0-develop.33",
34
+ "@progress/kendo-angular-icons": "19.3.0-develop.33",
35
+ "@progress/kendo-angular-popup": "19.3.0-develop.33",
36
36
  "rxjs": "^6.5.3 || ^7.0.0"
37
37
  },
38
38
  "dependencies": {
39
39
  "tslib": "^2.3.1",
40
- "@progress/kendo-angular-schematics": "19.3.0-develop.31"
40
+ "@progress/kendo-angular-schematics": "19.3.0-develop.33"
41
41
  },
42
42
  "schematics": "./schematics/collection.json",
43
43
  "module": "fesm2022/progress-kendo-angular-menu.mjs",
@@ -26,7 +26,7 @@ export declare class NavigationService {
26
26
  setFocus(item: any): void;
27
27
  focusLeave(): void;
28
28
  updateActive(): void;
29
- keydown(e: any): void;
29
+ keydown(e: KeyboardEvent): void;
30
30
  focusIndex(index?: string): void;
31
31
  focusFirst(): void;
32
32
  focusLast(): void;