@syncfusion/ej2-navigations 19.4.38 → 19.4.48

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/ej2-navigations.umd.min.js +2 -2
  3. package/dist/ej2-navigations.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-navigations.es2015.js +65 -32
  5. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  6. package/dist/es6/ej2-navigations.es5.js +64 -31
  7. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  8. package/dist/global/ej2-navigations.min.js +2 -2
  9. package/dist/global/ej2-navigations.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +11 -11
  12. package/src/accordion/accordion.js +10 -8
  13. package/src/common/menu-base.d.ts +1 -1
  14. package/src/common/menu-base.js +23 -12
  15. package/src/tab/tab.d.ts +7 -1
  16. package/src/tab/tab.js +12 -5
  17. package/src/toolbar/toolbar.js +19 -6
  18. package/styles/bootstrap-dark.css +3 -2
  19. package/styles/bootstrap.css +3 -2
  20. package/styles/bootstrap4.css +3 -2
  21. package/styles/bootstrap5-dark.css +3 -2
  22. package/styles/bootstrap5.css +3 -2
  23. package/styles/breadcrumb/_layout.scss +1 -1
  24. package/styles/breadcrumb/bootstrap-dark.css +1 -1
  25. package/styles/breadcrumb/bootstrap.css +1 -1
  26. package/styles/breadcrumb/bootstrap4.css +1 -1
  27. package/styles/breadcrumb/bootstrap5-dark.css +1 -1
  28. package/styles/breadcrumb/bootstrap5.css +1 -1
  29. package/styles/breadcrumb/fabric-dark.css +1 -1
  30. package/styles/breadcrumb/fabric.css +1 -1
  31. package/styles/breadcrumb/highcontrast-light.css +1 -1
  32. package/styles/breadcrumb/highcontrast.css +1 -1
  33. package/styles/breadcrumb/material-dark.css +1 -1
  34. package/styles/breadcrumb/material.css +1 -1
  35. package/styles/breadcrumb/tailwind-dark.css +1 -1
  36. package/styles/breadcrumb/tailwind.css +1 -1
  37. package/styles/fabric-dark.css +3 -2
  38. package/styles/fabric.css +3 -2
  39. package/styles/highcontrast-light.css +3 -2
  40. package/styles/highcontrast.css +3 -2
  41. package/styles/material-dark.css +3 -2
  42. package/styles/material.css +3 -2
  43. package/styles/menu/_layout.scss +2 -1
  44. package/styles/menu/bootstrap-dark.css +2 -1
  45. package/styles/menu/bootstrap.css +2 -1
  46. package/styles/menu/bootstrap4.css +2 -1
  47. package/styles/menu/bootstrap5-dark.css +2 -1
  48. package/styles/menu/bootstrap5.css +2 -1
  49. package/styles/menu/fabric-dark.css +2 -1
  50. package/styles/menu/fabric.css +2 -1
  51. package/styles/menu/highcontrast-light.css +2 -1
  52. package/styles/menu/highcontrast.css +2 -1
  53. package/styles/menu/material-dark.css +2 -1
  54. package/styles/menu/material.css +2 -1
  55. package/styles/menu/tailwind-dark.css +2 -1
  56. package/styles/menu/tailwind.css +2 -1
  57. package/styles/tailwind-dark.css +3 -2
  58. package/styles/tailwind.css +3 -2
@@ -2015,8 +2015,14 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2015
2015
  _this.setBlankIconStyle(_this.popupWrapper);
2016
2016
  _this.wireKeyboardEvent(_this.popupWrapper);
2017
2017
  rippleEffect(_this.popupWrapper, { selector: '.' + ITEM });
2018
- _this.popupWrapper.style.left = _this.left + 'px';
2019
- _this.popupWrapper.style.top = _this.top + 'px';
2018
+ if (_this.popupWrapper.style.position === 'fixed' && _this.top > 0) {
2019
+ _this.popupWrapper.style.left = _this.left + 'px';
2020
+ _this.popupWrapper.style.top = _this.top + scrollY + 'px';
2021
+ }
2022
+ else {
2023
+ _this.popupWrapper.style.left = _this.left + 'px';
2024
+ _this.popupWrapper.style.top = _this.top + 'px';
2025
+ }
2020
2026
  var animationOptions = _this.animationSettings.effect !== 'None' ? {
2021
2027
  name: _this.animationSettings.effect, duration: _this.animationSettings.duration,
2022
2028
  timingFunction: _this.animationSettings.easing
@@ -2539,21 +2545,26 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2539
2545
  * This method is used to set the menu item in the Menu based on the argument.
2540
2546
  *
2541
2547
  * @param {MenuItem} item - item need to be updated.
2542
- * @param {string} id - id to be passed to update the item.
2548
+ * @param {string} id - id / text to be passed to update the item.
2543
2549
  * @param {boolean} isUniqueId - Set `true` if it is a unique id.
2544
2550
  * @returns {void}
2545
2551
  */
2546
2552
  MenuBase.prototype.setItem = function (item, id, isUniqueId) {
2547
- var idx = id ? id : item.id;
2548
- var isText = (isUniqueId === false) ? false : true;
2549
- var navIdx = this.getIndex(idx, isText);
2553
+ var idx;
2554
+ if (isUniqueId) {
2555
+ idx = id ? id : item.id;
2556
+ }
2557
+ else {
2558
+ idx = id ? id : item.text;
2559
+ }
2560
+ var navIdx = this.getIndex(idx, isUniqueId);
2550
2561
  var newItem = this.getItem(navIdx);
2551
- newItem.iconCss = item.iconCss;
2552
- newItem.id = item.id;
2553
- newItem.text = item.text;
2554
- newItem.url = item.url;
2555
- newItem.separator = item.separator;
2556
- newItem.items = item.items;
2562
+ newItem.id = item.id || newItem.id;
2563
+ newItem.iconCss = item.iconCss || newItem.iconCss;
2564
+ newItem.text = item.text || newItem.text;
2565
+ newItem.url = item.url || newItem.url;
2566
+ newItem.separator = item.separator || newItem.separator;
2567
+ newItem.items = item.items || newItem.items;
2557
2568
  };
2558
2569
  MenuBase.prototype.getItem = function (navIdx) {
2559
2570
  navIdx = navIdx.slice();
@@ -3430,7 +3441,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3430
3441
  */
3431
3442
  Toolbar.prototype.destroy = function () {
3432
3443
  var _this = this;
3433
- if (this.isReact) {
3444
+ if (this.isReact || this.isAngular) {
3434
3445
  this.clearTemplate();
3435
3446
  }
3436
3447
  var btnItems = this.element.querySelectorAll('.e-control.e-btn');
@@ -3439,20 +3450,28 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3439
3450
  el.ej2_instances[0].destroy();
3440
3451
  }
3441
3452
  });
3442
- _super.prototype.destroy.call(this);
3443
3453
  this.unwireEvents();
3444
3454
  this.tempId.forEach(function (ele) {
3445
3455
  if (!isNullOrUndefined(_this.element.querySelector(ele))) {
3446
3456
  document.body.appendChild(_this.element.querySelector(ele)).style.display = 'none';
3447
3457
  }
3448
3458
  });
3459
+ this.destroyItems();
3449
3460
  while (this.element.lastElementChild) {
3450
3461
  this.element.removeChild(this.element.lastElementChild);
3451
3462
  }
3452
3463
  if (this.trgtEle) {
3453
3464
  this.element.appendChild(this.ctrlTem);
3465
+ this.trgtEle = null;
3466
+ this.ctrlTem = null;
3467
+ }
3468
+ if (this.popObj) {
3469
+ this.popObj.destroy();
3470
+ detach(this.popObj.element);
3471
+ }
3472
+ if (this.activeEle) {
3473
+ this.activeEle = null;
3454
3474
  }
3455
- this.clearProperty();
3456
3475
  this.popObj = null;
3457
3476
  this.tbarAlign = null;
3458
3477
  this.remove(this.element, 'e-toolpop');
@@ -3463,6 +3482,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3463
3482
  ['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach(function (attrb) {
3464
3483
  return _this.element.removeAttribute(attrb);
3465
3484
  });
3485
+ _super.prototype.destroy.call(this);
3466
3486
  };
3467
3487
  /**
3468
3488
  * Initialize the event handler
@@ -3552,8 +3572,8 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3552
3572
  if (this.element) {
3553
3573
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach(function (el) { detach(el); });
3554
3574
  }
3555
- var tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3556
3575
  if (this.tbarAlign) {
3576
+ var tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3557
3577
  [].slice.call(tbarItems.children).forEach(function (el) {
3558
3578
  detach(el);
3559
3579
  });
@@ -3637,6 +3657,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3637
3657
  case 'end':
3638
3658
  if (clst) {
3639
3659
  var popupCheck = closest(clst, '.e-popup');
3660
+ var extendedPopup = this.element.querySelector('.' + CLS_EXTENDABLECLASS);
3661
+ if (this.overflowMode === 'Extended' && extendedPopup && extendedPopup.classList.contains('e-popup-open')) {
3662
+ popupCheck = e.action === 'end' ? extendedPopup : null;
3663
+ }
3640
3664
  if (popupCheck) {
3641
3665
  if (isVisible(this.popObj.element)) {
3642
3666
  nodes = [].slice.call(popupCheck.children);
@@ -3649,7 +3673,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3649
3673
  }
3650
3674
  }
3651
3675
  else {
3652
- nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);
3676
+ nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3653
3677
  if (e.action === 'home') {
3654
3678
  ele = nodes[0];
3655
3679
  }
@@ -5193,7 +5217,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
5193
5217
  };
5194
5218
  Toolbar.prototype.itemsRerender = function (newProp) {
5195
5219
  this.items = this.tbarItemsCol;
5196
- if (this.isReact) {
5220
+ if (this.isReact || this.isAngular) {
5197
5221
  this.clearTemplate();
5198
5222
  }
5199
5223
  this.destroyMode();
@@ -5662,7 +5686,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5662
5686
  */
5663
5687
  Accordion.prototype.destroy = function () {
5664
5688
  var _this = this;
5665
- if (this.isReact) {
5689
+ if (this.isReact || this.isAngular || this.isVue) {
5666
5690
  this.clearTemplate();
5667
5691
  }
5668
5692
  var ele = this.element;
@@ -5674,9 +5698,11 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5674
5698
  ele.removeChild(el);
5675
5699
  });
5676
5700
  if (this.trgtEle) {
5701
+ this.trgtEle = null;
5677
5702
  while (this.ctrlTem.firstElementChild) {
5678
5703
  ele.appendChild(this.ctrlTem.firstElementChild);
5679
5704
  }
5705
+ this.ctrlTem = null;
5680
5706
  }
5681
5707
  ele.classList.remove(CLS_ACRDN_ROOT);
5682
5708
  ele.removeAttribute('style');
@@ -6037,11 +6063,13 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6037
6063
  else {
6038
6064
  trgt.click();
6039
6065
  }
6066
+ e.preventDefault();
6040
6067
  break;
6041
6068
  case 'home':
6042
6069
  case 'end':
6043
6070
  clst = e.action === 'home' ? root.firstElementChild.children[0] : root.lastElementChild.children[0];
6044
6071
  clst.focus();
6072
+ e.preventDefault();
6045
6073
  break;
6046
6074
  }
6047
6075
  };
@@ -6056,12 +6084,10 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6056
6084
  return header;
6057
6085
  };
6058
6086
  Accordion.prototype.renderInnerItem = function (item, index) {
6059
- var innerEle = this.createElement('div', { className: CLS_ITEM$1 });
6060
- innerEle.id = getUniqueID('acrdn_item');
6061
- if (isNullOrUndefined(item.id)) {
6062
- item.id = innerEle.id;
6063
- }
6064
- attributes(innerEle, { 'aria-expanded': 'false', 'role': 'row' });
6087
+ var innerEle = this.createElement('div', {
6088
+ className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item'),
6089
+ attrs: { 'aria-expanded': 'false', 'role': 'row' }
6090
+ });
6065
6091
  if (this.headerTemplate) {
6066
6092
  var ctnEle = this.headerEleGenerate();
6067
6093
  var hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
@@ -6665,7 +6691,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6665
6691
  };
6666
6692
  Accordion.prototype.destroyItems = function () {
6667
6693
  this.restoreContent(null);
6668
- if (this.isReact) {
6694
+ if (this.isReact || this.isAngular || this.isVue) {
6669
6695
  this.clearTemplate();
6670
6696
  }
6671
6697
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM$1)).forEach(function (el) {
@@ -7479,7 +7505,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7479
7505
  _this.isAdd = false;
7480
7506
  _this.isIconAlone = false;
7481
7507
  _this.draggableItems = [];
7482
- _this.resizeContext = _this.refreshActElePosition.bind(_this);
7508
+ _this.resizeContext = _this.refreshActiveTabBorder.bind(_this);
7483
7509
  /**
7484
7510
  * Contains the keyboard configuration of the Tab.
7485
7511
  */
@@ -7932,7 +7958,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7932
7958
  trg.classList.remove(CLS_CLOSE_SHOW);
7933
7959
  }
7934
7960
  this.tbObj.refreshOverflow();
7935
- this.refreshActElePosition();
7961
+ this.refreshActiveTabBorder();
7936
7962
  };
7937
7963
  Tab.prototype.prevCtnAnimation = function (prev, current) {
7938
7964
  var animation;
@@ -8130,6 +8156,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8130
8156
  };
8131
8157
  Tab.prototype.getContent = function (ele, cnt, callType, index) {
8132
8158
  var eleStr;
8159
+ cnt = isNullOrUndefined(cnt) ? "" : cnt;
8133
8160
  if (typeof cnt === 'string' || isNullOrUndefined(cnt.innerHTML)) {
8134
8161
  if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
8135
8162
  cnt = SanitizeHtmlHelper.sanitize(cnt);
@@ -8648,7 +8675,13 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8648
8675
  break;
8649
8676
  }
8650
8677
  };
8651
- Tab.prototype.refreshActElePosition = function () {
8678
+ /**
8679
+ * Refresh the active tab border
8680
+ *
8681
+ * @returns {void}
8682
+ * @private
8683
+ */
8684
+ Tab.prototype.refreshActiveTabBorder = function () {
8652
8685
  var activeEle = select('.' + CLS_TB_ITEM + '.' + CLS_TB_POPUP + '.' + CLS_ACTIVE$1, this.element);
8653
8686
  if (!isNullOrUndefined(activeEle) && this.reorderActiveTab) {
8654
8687
  this.select(this.getEleIndex(activeEle));
@@ -9400,7 +9433,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9400
9433
  this.setCloseButton(newProp.showCloseButton);
9401
9434
  break;
9402
9435
  case 'reorderActiveTab':
9403
- this.refreshActElePosition();
9436
+ this.refreshActiveTabBorder();
9404
9437
  break;
9405
9438
  case 'selectedItem':
9406
9439
  this.selectedItem = oldProp.selectedItem;
@@ -9415,7 +9448,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9415
9448
  case 'overflowMode':
9416
9449
  this.tbObj.overflowMode = newProp.overflowMode;
9417
9450
  this.tbObj.dataBind();
9418
- this.refreshActElePosition();
9451
+ this.refreshActiveTabBorder();
9419
9452
  break;
9420
9453
  case 'heightAdjustMode':
9421
9454
  this.setContentHeight(false);