@syncfusion/ej2-navigations 32.2.6 → 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.
@@ -1215,6 +1215,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1215
1215
  _this.isOpenCalled = false;
1216
1216
  _this.isAnimationNone = false;
1217
1217
  _this.isKBDAction = false;
1218
+ _this.skipNextArrowDown = false;
1218
1219
  return _this;
1219
1220
  }
1220
1221
  /**
@@ -1322,7 +1323,8 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1322
1323
  this.element.parentElement.insertBefore(wrapper, this.element);
1323
1324
  }
1324
1325
  else {
1325
- document.body.appendChild(wrapper);
1326
+ var appendToElement = this.getAppendToElement();
1327
+ appendToElement.appendChild(wrapper);
1326
1328
  }
1327
1329
  }
1328
1330
  if (this.cssClass) {
@@ -1459,8 +1461,38 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1459
1461
  e.action = ESCAPE;
1460
1462
  this.leftEscKeyHandler(e);
1461
1463
  }
1464
+ var isDown = e.key ? (e.key === 'ArrowDown') : e.keyCode === 40;
1465
+ if (!isDown) {
1466
+ return;
1467
+ }
1468
+ var hostPopup = closest(this.element, '.e-popup-open');
1469
+ if (!hostPopup) {
1470
+ return;
1471
+ }
1472
+ if (closest(document.activeElement, '#' + this.element.id)) {
1473
+ return;
1474
+ }
1475
+ var active = document.activeElement;
1476
+ if (!active) {
1477
+ return;
1478
+ }
1479
+ var expanded = active.getAttribute('aria-expanded') === 'true';
1480
+ if (!expanded) {
1481
+ return;
1482
+ }
1483
+ var ul = this.element;
1484
+ var firstItem = select('.e-menu-item', ul);
1485
+ if (firstItem) {
1486
+ ul.focus();
1487
+ firstItem.classList.add('e-focused');
1488
+ this.skipNextArrowDown = true;
1489
+ }
1462
1490
  };
1463
1491
  MenuBase.prototype.keyBoardHandler = function (e) {
1492
+ if (e.action === DOWNARROW && this.skipNextArrowDown) {
1493
+ this.skipNextArrowDown = false;
1494
+ return;
1495
+ }
1464
1496
  var actionName = '';
1465
1497
  var trgt = e.target;
1466
1498
  var actionNeeded = this.isMenu && !this.hamburgerMode && !this.element.classList.contains('e-vertical')
@@ -1560,6 +1592,9 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1560
1592
  fliIdx = this.isValidLI(cli, fliIdx, e.action);
1561
1593
  cul.children[fliIdx].classList.add(FOCUSED);
1562
1594
  cul.children[fliIdx].focus();
1595
+ if (closest(this.element, '.e-popup')) {
1596
+ cul.focus();
1597
+ }
1563
1598
  };
1564
1599
  MenuBase.prototype.isValidLI = function (cli, index, action) {
1565
1600
  var cul = this.getUlByNavIdx();
@@ -1603,7 +1638,8 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1603
1638
  return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
1604
1639
  }
1605
1640
  else {
1606
- if (!document.body.contains(this.element) && navIdxLen === 0) {
1641
+ var appendToElement = this.getAppendToElement();
1642
+ if (!appendToElement.contains(this.element) && navIdxLen === 0) {
1607
1643
  return null;
1608
1644
  }
1609
1645
  return this.getWrapper().children[navIdxLen];
@@ -1959,7 +1995,8 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1959
1995
  li.appendChild(this.popupWrapper);
1960
1996
  }
1961
1997
  else {
1962
- document.body.appendChild(this.popupWrapper);
1998
+ var appendToElement = this.getAppendToElement();
1999
+ appendToElement.appendChild(this.popupWrapper);
1963
2000
  }
1964
2001
  this.isNestedOrVertical = this.element.classList.contains('e-vertical') || this.navIdx.length !== 1;
1965
2002
  this.popupObj = this.generatePopup(this.popupWrapper, this.uList, li, this.isNestedOrVertical);
@@ -3260,6 +3297,16 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
3260
3297
  }
3261
3298
  }
3262
3299
  };
3300
+ MenuBase.prototype.getAppendToElement = function () {
3301
+ if (this.isAngular) {
3302
+ var cdkPane = this.element.closest('.cdk-overlay-pane');
3303
+ var popoverEl = this.element.closest('[popover]');
3304
+ if (cdkPane && popoverEl) {
3305
+ return cdkPane;
3306
+ }
3307
+ }
3308
+ return document.body;
3309
+ };
3263
3310
  /**
3264
3311
  * Get the properties to be maintained in the persisted state.
3265
3312
  *
@@ -9010,9 +9057,11 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9010
9057
  }
9011
9058
  else if (this.heightAdjustMode === 'Fill') {
9012
9059
  addClass([this.element], [CLS_FILL]);
9013
- setStyleAttribute(this.element, { 'height': '100%' });
9060
+ var parent_1 = this.element.parentElement;
9061
+ var heightVal = parent_1.style.height || parent_1.getAttribute('height');
9062
+ setStyleAttribute(this.element, { 'height': heightVal != null ? heightVal : '100%' });
9014
9063
  this.loadContentElement();
9015
- this.cntEle.style.height = 'calc(100% - ' + this.hdrEle.offsetHeight + 'px)';
9064
+ this.cntEle.style.height = heightVal != null ? "calc(" + heightVal + " - " + this.hdrEle.offsetHeight + "px)" : 'calc(100vh - ' + this.hdrEle.offsetHeight + 'px)';
9016
9065
  }
9017
9066
  else if (this.heightAdjustMode === 'Auto') {
9018
9067
  if (this.isTemplate === true) {
@@ -10827,6 +10876,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
10827
10876
  _this.beforeNodeCreate(e);
10828
10877
  },
10829
10878
  enableHtmlSanitizer: this.enableHtmlSanitizer,
10879
+ disableHtmlEncode: this.disableHtmlEncode,
10830
10880
  itemNavigable: this.fullRowNavigable
10831
10881
  };
10832
10882
  this.updateListProp(this.fields);
@@ -13917,12 +13967,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13917
13967
  this.renderReactTemplates();
13918
13968
  }
13919
13969
  else {
13920
- if (this.enableHtmlSanitizer) {
13921
- txtEle.innerText = SanitizeHtmlHelper.sanitize(newText);
13922
- }
13923
- else {
13924
- txtEle.innerHTML = newText;
13925
- }
13970
+ txtEle[ListBase.getDomSetter(this.listBaseOption)] = ListBase.getSanitizedText(newText, this.listBaseOption);
13926
13971
  }
13927
13972
  if (isInput) {
13928
13973
  removeClass([liEle], EDITING);
@@ -16363,6 +16408,9 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
16363
16408
  __decorate$8([
16364
16409
  Property(true)
16365
16410
  ], TreeView.prototype, "enableHtmlSanitizer", void 0);
16411
+ __decorate$8([
16412
+ Property(true)
16413
+ ], TreeView.prototype, "disableHtmlEncode", void 0);
16366
16414
  __decorate$8([
16367
16415
  Property(false)
16368
16416
  ], TreeView.prototype, "enablePersistence", void 0);
@@ -17039,6 +17087,12 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
17039
17087
  if (!this.getState()) {
17040
17088
  this.setDock();
17041
17089
  }
17090
+ if (!this.enableDock) {
17091
+ removeClass([this.element], DOCKER);
17092
+ }
17093
+ else {
17094
+ addClass([this.element], DOCKER);
17095
+ }
17042
17096
  break;
17043
17097
  case 'zIndex':
17044
17098
  this.setZindex();