@syncfusion/ej2-navigations 19.4.40 → 19.4.50

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 +42 -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 +63 -32
  5. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  6. package/dist/es6/ej2-navigations.es5.js +62 -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 +12 -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 +21 -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,24 @@ 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.iconCss = item.iconCss || newItem.iconCss;
2563
+ newItem.text = item.text || newItem.text;
2564
+ newItem.url = item.url || newItem.url;
2565
+ newItem.separator = item.separator || newItem.separator;
2557
2566
  };
2558
2567
  MenuBase.prototype.getItem = function (navIdx) {
2559
2568
  navIdx = navIdx.slice();
@@ -3430,7 +3439,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3430
3439
  */
3431
3440
  Toolbar.prototype.destroy = function () {
3432
3441
  var _this = this;
3433
- if (this.isReact) {
3442
+ if (this.isReact || this.isAngular) {
3434
3443
  this.clearTemplate();
3435
3444
  }
3436
3445
  var btnItems = this.element.querySelectorAll('.e-control.e-btn');
@@ -3439,20 +3448,28 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3439
3448
  el.ej2_instances[0].destroy();
3440
3449
  }
3441
3450
  });
3442
- _super.prototype.destroy.call(this);
3443
3451
  this.unwireEvents();
3444
3452
  this.tempId.forEach(function (ele) {
3445
3453
  if (!isNullOrUndefined(_this.element.querySelector(ele))) {
3446
3454
  document.body.appendChild(_this.element.querySelector(ele)).style.display = 'none';
3447
3455
  }
3448
3456
  });
3457
+ this.destroyItems();
3449
3458
  while (this.element.lastElementChild) {
3450
3459
  this.element.removeChild(this.element.lastElementChild);
3451
3460
  }
3452
3461
  if (this.trgtEle) {
3453
3462
  this.element.appendChild(this.ctrlTem);
3463
+ this.trgtEle = null;
3464
+ this.ctrlTem = null;
3465
+ }
3466
+ if (this.popObj) {
3467
+ this.popObj.destroy();
3468
+ detach(this.popObj.element);
3469
+ }
3470
+ if (this.activeEle) {
3471
+ this.activeEle = null;
3454
3472
  }
3455
- this.clearProperty();
3456
3473
  this.popObj = null;
3457
3474
  this.tbarAlign = null;
3458
3475
  this.remove(this.element, 'e-toolpop');
@@ -3463,6 +3480,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3463
3480
  ['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach(function (attrb) {
3464
3481
  return _this.element.removeAttribute(attrb);
3465
3482
  });
3483
+ _super.prototype.destroy.call(this);
3466
3484
  };
3467
3485
  /**
3468
3486
  * Initialize the event handler
@@ -3552,8 +3570,8 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3552
3570
  if (this.element) {
3553
3571
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach(function (el) { detach(el); });
3554
3572
  }
3555
- var tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3556
3573
  if (this.tbarAlign) {
3574
+ var tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3557
3575
  [].slice.call(tbarItems.children).forEach(function (el) {
3558
3576
  detach(el);
3559
3577
  });
@@ -3637,6 +3655,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3637
3655
  case 'end':
3638
3656
  if (clst) {
3639
3657
  var popupCheck = closest(clst, '.e-popup');
3658
+ var extendedPopup = this.element.querySelector('.' + CLS_EXTENDABLECLASS);
3659
+ if (this.overflowMode === 'Extended' && extendedPopup && extendedPopup.classList.contains('e-popup-open')) {
3660
+ popupCheck = e.action === 'end' ? extendedPopup : null;
3661
+ }
3640
3662
  if (popupCheck) {
3641
3663
  if (isVisible(this.popObj.element)) {
3642
3664
  nodes = [].slice.call(popupCheck.children);
@@ -3649,7 +3671,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3649
3671
  }
3650
3672
  }
3651
3673
  else {
3652
- nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);
3674
+ nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3653
3675
  if (e.action === 'home') {
3654
3676
  ele = nodes[0];
3655
3677
  }
@@ -5193,7 +5215,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
5193
5215
  };
5194
5216
  Toolbar.prototype.itemsRerender = function (newProp) {
5195
5217
  this.items = this.tbarItemsCol;
5196
- if (this.isReact) {
5218
+ if (this.isReact || this.isAngular) {
5197
5219
  this.clearTemplate();
5198
5220
  }
5199
5221
  this.destroyMode();
@@ -5662,7 +5684,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5662
5684
  */
5663
5685
  Accordion.prototype.destroy = function () {
5664
5686
  var _this = this;
5665
- if (this.isReact) {
5687
+ if (this.isReact || this.isAngular || this.isVue) {
5666
5688
  this.clearTemplate();
5667
5689
  }
5668
5690
  var ele = this.element;
@@ -5674,9 +5696,11 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5674
5696
  ele.removeChild(el);
5675
5697
  });
5676
5698
  if (this.trgtEle) {
5699
+ this.trgtEle = null;
5677
5700
  while (this.ctrlTem.firstElementChild) {
5678
5701
  ele.appendChild(this.ctrlTem.firstElementChild);
5679
5702
  }
5703
+ this.ctrlTem = null;
5680
5704
  }
5681
5705
  ele.classList.remove(CLS_ACRDN_ROOT);
5682
5706
  ele.removeAttribute('style');
@@ -6037,11 +6061,13 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6037
6061
  else {
6038
6062
  trgt.click();
6039
6063
  }
6064
+ e.preventDefault();
6040
6065
  break;
6041
6066
  case 'home':
6042
6067
  case 'end':
6043
6068
  clst = e.action === 'home' ? root.firstElementChild.children[0] : root.lastElementChild.children[0];
6044
6069
  clst.focus();
6070
+ e.preventDefault();
6045
6071
  break;
6046
6072
  }
6047
6073
  };
@@ -6056,12 +6082,10 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6056
6082
  return header;
6057
6083
  };
6058
6084
  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' });
6085
+ var innerEle = this.createElement('div', {
6086
+ className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item'),
6087
+ attrs: { 'aria-expanded': 'false', 'role': 'row' }
6088
+ });
6065
6089
  if (this.headerTemplate) {
6066
6090
  var ctnEle = this.headerEleGenerate();
6067
6091
  var hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
@@ -6665,7 +6689,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6665
6689
  };
6666
6690
  Accordion.prototype.destroyItems = function () {
6667
6691
  this.restoreContent(null);
6668
- if (this.isReact) {
6692
+ if (this.isReact || this.isAngular || this.isVue) {
6669
6693
  this.clearTemplate();
6670
6694
  }
6671
6695
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM$1)).forEach(function (el) {
@@ -7479,7 +7503,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7479
7503
  _this.isAdd = false;
7480
7504
  _this.isIconAlone = false;
7481
7505
  _this.draggableItems = [];
7482
- _this.resizeContext = _this.refreshActElePosition.bind(_this);
7506
+ _this.resizeContext = _this.refreshActiveTabBorder.bind(_this);
7483
7507
  /**
7484
7508
  * Contains the keyboard configuration of the Tab.
7485
7509
  */
@@ -7932,7 +7956,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7932
7956
  trg.classList.remove(CLS_CLOSE_SHOW);
7933
7957
  }
7934
7958
  this.tbObj.refreshOverflow();
7935
- this.refreshActElePosition();
7959
+ this.refreshActiveTabBorder();
7936
7960
  };
7937
7961
  Tab.prototype.prevCtnAnimation = function (prev, current) {
7938
7962
  var animation;
@@ -8130,6 +8154,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8130
8154
  };
8131
8155
  Tab.prototype.getContent = function (ele, cnt, callType, index) {
8132
8156
  var eleStr;
8157
+ cnt = isNullOrUndefined(cnt) ? "" : cnt;
8133
8158
  if (typeof cnt === 'string' || isNullOrUndefined(cnt.innerHTML)) {
8134
8159
  if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
8135
8160
  cnt = SanitizeHtmlHelper.sanitize(cnt);
@@ -8648,7 +8673,13 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8648
8673
  break;
8649
8674
  }
8650
8675
  };
8651
- Tab.prototype.refreshActElePosition = function () {
8676
+ /**
8677
+ * Refresh the active tab border
8678
+ *
8679
+ * @returns {void}
8680
+ * @private
8681
+ */
8682
+ Tab.prototype.refreshActiveTabBorder = function () {
8652
8683
  var activeEle = select('.' + CLS_TB_ITEM + '.' + CLS_TB_POPUP + '.' + CLS_ACTIVE$1, this.element);
8653
8684
  if (!isNullOrUndefined(activeEle) && this.reorderActiveTab) {
8654
8685
  this.select(this.getEleIndex(activeEle));
@@ -9400,7 +9431,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9400
9431
  this.setCloseButton(newProp.showCloseButton);
9401
9432
  break;
9402
9433
  case 'reorderActiveTab':
9403
- this.refreshActElePosition();
9434
+ this.refreshActiveTabBorder();
9404
9435
  break;
9405
9436
  case 'selectedItem':
9406
9437
  this.selectedItem = oldProp.selectedItem;
@@ -9415,7 +9446,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9415
9446
  case 'overflowMode':
9416
9447
  this.tbObj.overflowMode = newProp.overflowMode;
9417
9448
  this.tbObj.dataBind();
9418
- this.refreshActElePosition();
9449
+ this.refreshActiveTabBorder();
9419
9450
  break;
9420
9451
  case 'heightAdjustMode':
9421
9452
  this.setContentHeight(false);