@syncfusion/ej2-navigations 32.2.7 → 32.2.8

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 32.2.7
3
+ * version : 32.2.8
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-navigations",
3
- "version": "32.2.7",
3
+ "version": "32.2.8",
4
4
  "description": "A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -11,9 +11,9 @@
11
11
  "@syncfusion/ej2-base": "~32.2.6",
12
12
  "@syncfusion/ej2-buttons": "~32.2.7",
13
13
  "@syncfusion/ej2-data": "~32.2.3",
14
- "@syncfusion/ej2-inputs": "~32.2.7",
14
+ "@syncfusion/ej2-inputs": "~32.2.8",
15
15
  "@syncfusion/ej2-lists": "~32.2.7",
16
- "@syncfusion/ej2-popups": "~32.2.7"
16
+ "@syncfusion/ej2-popups": "~32.2.8"
17
17
  },
18
18
  "devDependencies": {},
19
19
  "keywords": [
@@ -192,6 +192,7 @@ export declare abstract class MenuBase extends Component<HTMLUListElement> imple
192
192
  protected isOpenCalled: boolean;
193
193
  private isAnimationNone;
194
194
  private isKBDAction;
195
+ private skipNextArrowDown;
195
196
  private touchStartFn;
196
197
  private touchMoveFn;
197
198
  /**
@@ -448,6 +449,7 @@ export declare abstract class MenuBase extends Component<HTMLUListElement> imple
448
449
  private toggleAnimation;
449
450
  private triggerOpen;
450
451
  private end;
452
+ protected getAppendToElement(): HTMLElement;
451
453
  /**
452
454
  * Get the properties to be maintained in the persisted state.
453
455
  *
@@ -158,6 +158,7 @@ var MenuBase = /** @class */ (function (_super) {
158
158
  _this.isOpenCalled = false;
159
159
  _this.isAnimationNone = false;
160
160
  _this.isKBDAction = false;
161
+ _this.skipNextArrowDown = false;
161
162
  return _this;
162
163
  }
163
164
  /**
@@ -265,7 +266,8 @@ var MenuBase = /** @class */ (function (_super) {
265
266
  this.element.parentElement.insertBefore(wrapper, this.element);
266
267
  }
267
268
  else {
268
- document.body.appendChild(wrapper);
269
+ var appendToElement = this.getAppendToElement();
270
+ appendToElement.appendChild(wrapper);
269
271
  }
270
272
  }
271
273
  if (this.cssClass) {
@@ -402,8 +404,38 @@ var MenuBase = /** @class */ (function (_super) {
402
404
  e.action = ESCAPE;
403
405
  this.leftEscKeyHandler(e);
404
406
  }
407
+ var isDown = e.key ? (e.key === 'ArrowDown') : e.keyCode === 40;
408
+ if (!isDown) {
409
+ return;
410
+ }
411
+ var hostPopup = closest(this.element, '.e-popup-open');
412
+ if (!hostPopup) {
413
+ return;
414
+ }
415
+ if (closest(document.activeElement, '#' + this.element.id)) {
416
+ return;
417
+ }
418
+ var active = document.activeElement;
419
+ if (!active) {
420
+ return;
421
+ }
422
+ var expanded = active.getAttribute('aria-expanded') === 'true';
423
+ if (!expanded) {
424
+ return;
425
+ }
426
+ var ul = this.element;
427
+ var firstItem = select('.e-menu-item', ul);
428
+ if (firstItem) {
429
+ ul.focus();
430
+ firstItem.classList.add('e-focused');
431
+ this.skipNextArrowDown = true;
432
+ }
405
433
  };
406
434
  MenuBase.prototype.keyBoardHandler = function (e) {
435
+ if (e.action === DOWNARROW && this.skipNextArrowDown) {
436
+ this.skipNextArrowDown = false;
437
+ return;
438
+ }
407
439
  var actionName = '';
408
440
  var trgt = e.target;
409
441
  var actionNeeded = this.isMenu && !this.hamburgerMode && !this.element.classList.contains('e-vertical')
@@ -503,6 +535,9 @@ var MenuBase = /** @class */ (function (_super) {
503
535
  fliIdx = this.isValidLI(cli, fliIdx, e.action);
504
536
  cul.children[fliIdx].classList.add(FOCUSED);
505
537
  cul.children[fliIdx].focus();
538
+ if (closest(this.element, '.e-popup')) {
539
+ cul.focus();
540
+ }
506
541
  };
507
542
  MenuBase.prototype.isValidLI = function (cli, index, action) {
508
543
  var cul = this.getUlByNavIdx();
@@ -546,7 +581,8 @@ var MenuBase = /** @class */ (function (_super) {
546
581
  return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
547
582
  }
548
583
  else {
549
- if (!document.body.contains(this.element) && navIdxLen === 0) {
584
+ var appendToElement = this.getAppendToElement();
585
+ if (!appendToElement.contains(this.element) && navIdxLen === 0) {
550
586
  return null;
551
587
  }
552
588
  return this.getWrapper().children[navIdxLen];
@@ -902,7 +938,8 @@ var MenuBase = /** @class */ (function (_super) {
902
938
  li.appendChild(this.popupWrapper);
903
939
  }
904
940
  else {
905
- document.body.appendChild(this.popupWrapper);
941
+ var appendToElement = this.getAppendToElement();
942
+ appendToElement.appendChild(this.popupWrapper);
906
943
  }
907
944
  this.isNestedOrVertical = this.element.classList.contains('e-vertical') || this.navIdx.length !== 1;
908
945
  this.popupObj = this.generatePopup(this.popupWrapper, this.uList, li, this.isNestedOrVertical);
@@ -2203,6 +2240,16 @@ var MenuBase = /** @class */ (function (_super) {
2203
2240
  }
2204
2241
  }
2205
2242
  };
2243
+ MenuBase.prototype.getAppendToElement = function () {
2244
+ if (this.isAngular) {
2245
+ var cdkPane = this.element.closest('.cdk-overlay-pane');
2246
+ var popoverEl = this.element.closest('[popover]');
2247
+ if (cdkPane && popoverEl) {
2248
+ return cdkPane;
2249
+ }
2250
+ }
2251
+ return document.body;
2252
+ };
2206
2253
  /**
2207
2254
  * Get the properties to be maintained in the persisted state.
2208
2255
  *