@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
@@ -1926,8 +1926,14 @@ let MenuBase = class MenuBase extends Component {
1926
1926
  this.setBlankIconStyle(this.popupWrapper);
1927
1927
  this.wireKeyboardEvent(this.popupWrapper);
1928
1928
  rippleEffect(this.popupWrapper, { selector: '.' + ITEM });
1929
- this.popupWrapper.style.left = this.left + 'px';
1930
- this.popupWrapper.style.top = this.top + 'px';
1929
+ if (this.popupWrapper.style.position === 'fixed' && this.top > 0) {
1930
+ this.popupWrapper.style.left = this.left + 'px';
1931
+ this.popupWrapper.style.top = this.top + scrollY + 'px';
1932
+ }
1933
+ else {
1934
+ this.popupWrapper.style.left = this.left + 'px';
1935
+ this.popupWrapper.style.top = this.top + 'px';
1936
+ }
1931
1937
  const animationOptions = this.animationSettings.effect !== 'None' ? {
1932
1938
  name: this.animationSettings.effect, duration: this.animationSettings.duration,
1933
1939
  timingFunction: this.animationSettings.easing
@@ -2443,21 +2449,24 @@ let MenuBase = class MenuBase extends Component {
2443
2449
  * This method is used to set the menu item in the Menu based on the argument.
2444
2450
  *
2445
2451
  * @param {MenuItem} item - item need to be updated.
2446
- * @param {string} id - id to be passed to update the item.
2452
+ * @param {string} id - id / text to be passed to update the item.
2447
2453
  * @param {boolean} isUniqueId - Set `true` if it is a unique id.
2448
2454
  * @returns {void}
2449
2455
  */
2450
2456
  setItem(item, id, isUniqueId) {
2451
- const idx = id ? id : item.id;
2452
- const isText = (isUniqueId === false) ? false : true;
2453
- const navIdx = this.getIndex(idx, isText);
2457
+ let idx;
2458
+ if (isUniqueId) {
2459
+ idx = id ? id : item.id;
2460
+ }
2461
+ else {
2462
+ idx = id ? id : item.text;
2463
+ }
2464
+ const navIdx = this.getIndex(idx, isUniqueId);
2454
2465
  const newItem = this.getItem(navIdx);
2455
- newItem.iconCss = item.iconCss;
2456
- newItem.id = item.id;
2457
- newItem.text = item.text;
2458
- newItem.url = item.url;
2459
- newItem.separator = item.separator;
2460
- newItem.items = item.items;
2466
+ newItem.iconCss = item.iconCss || newItem.iconCss;
2467
+ newItem.text = item.text || newItem.text;
2468
+ newItem.url = item.url || newItem.url;
2469
+ newItem.separator = item.separator || newItem.separator;
2461
2470
  }
2462
2471
  getItem(navIdx) {
2463
2472
  navIdx = navIdx.slice();
@@ -3294,7 +3303,7 @@ let Toolbar = class Toolbar extends Component {
3294
3303
  * @returns {void}.
3295
3304
  */
3296
3305
  destroy() {
3297
- if (this.isReact) {
3306
+ if (this.isReact || this.isAngular) {
3298
3307
  this.clearTemplate();
3299
3308
  }
3300
3309
  const btnItems = this.element.querySelectorAll('.e-control.e-btn');
@@ -3303,20 +3312,28 @@ let Toolbar = class Toolbar extends Component {
3303
3312
  el.ej2_instances[0].destroy();
3304
3313
  }
3305
3314
  });
3306
- super.destroy();
3307
3315
  this.unwireEvents();
3308
3316
  this.tempId.forEach((ele) => {
3309
3317
  if (!isNullOrUndefined(this.element.querySelector(ele))) {
3310
3318
  document.body.appendChild(this.element.querySelector(ele)).style.display = 'none';
3311
3319
  }
3312
3320
  });
3321
+ this.destroyItems();
3313
3322
  while (this.element.lastElementChild) {
3314
3323
  this.element.removeChild(this.element.lastElementChild);
3315
3324
  }
3316
3325
  if (this.trgtEle) {
3317
3326
  this.element.appendChild(this.ctrlTem);
3327
+ this.trgtEle = null;
3328
+ this.ctrlTem = null;
3329
+ }
3330
+ if (this.popObj) {
3331
+ this.popObj.destroy();
3332
+ detach(this.popObj.element);
3333
+ }
3334
+ if (this.activeEle) {
3335
+ this.activeEle = null;
3318
3336
  }
3319
- this.clearProperty();
3320
3337
  this.popObj = null;
3321
3338
  this.tbarAlign = null;
3322
3339
  this.remove(this.element, 'e-toolpop');
@@ -3325,6 +3342,7 @@ let Toolbar = class Toolbar extends Component {
3325
3342
  }
3326
3343
  this.element.removeAttribute('style');
3327
3344
  ['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach((attrb) => this.element.removeAttribute(attrb));
3345
+ super.destroy();
3328
3346
  }
3329
3347
  /**
3330
3348
  * Initialize the event handler
@@ -3414,8 +3432,8 @@ let Toolbar = class Toolbar extends Component {
3414
3432
  if (this.element) {
3415
3433
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach((el) => { detach(el); });
3416
3434
  }
3417
- const tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3418
3435
  if (this.tbarAlign) {
3436
+ const tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3419
3437
  [].slice.call(tbarItems.children).forEach((el) => {
3420
3438
  detach(el);
3421
3439
  });
@@ -3498,7 +3516,11 @@ let Toolbar = class Toolbar extends Component {
3498
3516
  case 'home':
3499
3517
  case 'end':
3500
3518
  if (clst) {
3501
- const popupCheck = closest(clst, '.e-popup');
3519
+ let popupCheck = closest(clst, '.e-popup');
3520
+ const extendedPopup = this.element.querySelector('.' + CLS_EXTENDABLECLASS);
3521
+ if (this.overflowMode === 'Extended' && extendedPopup && extendedPopup.classList.contains('e-popup-open')) {
3522
+ popupCheck = e.action === 'end' ? extendedPopup : null;
3523
+ }
3502
3524
  if (popupCheck) {
3503
3525
  if (isVisible(this.popObj.element)) {
3504
3526
  nodes = [].slice.call(popupCheck.children);
@@ -3511,7 +3533,7 @@ let Toolbar = class Toolbar extends Component {
3511
3533
  }
3512
3534
  }
3513
3535
  else {
3514
- nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);
3536
+ nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3515
3537
  if (e.action === 'home') {
3516
3538
  ele = nodes[0];
3517
3539
  }
@@ -5041,7 +5063,7 @@ let Toolbar = class Toolbar extends Component {
5041
5063
  }
5042
5064
  itemsRerender(newProp) {
5043
5065
  this.items = this.tbarItemsCol;
5044
- if (this.isReact) {
5066
+ if (this.isReact || this.isAngular) {
5045
5067
  this.clearTemplate();
5046
5068
  }
5047
5069
  this.destroyMode();
@@ -5477,7 +5499,7 @@ let Accordion = class Accordion extends Component {
5477
5499
  * @returns {void}
5478
5500
  */
5479
5501
  destroy() {
5480
- if (this.isReact) {
5502
+ if (this.isReact || this.isAngular || this.isVue) {
5481
5503
  this.clearTemplate();
5482
5504
  }
5483
5505
  const ele = this.element;
@@ -5489,9 +5511,11 @@ let Accordion = class Accordion extends Component {
5489
5511
  ele.removeChild(el);
5490
5512
  });
5491
5513
  if (this.trgtEle) {
5514
+ this.trgtEle = null;
5492
5515
  while (this.ctrlTem.firstElementChild) {
5493
5516
  ele.appendChild(this.ctrlTem.firstElementChild);
5494
5517
  }
5518
+ this.ctrlTem = null;
5495
5519
  }
5496
5520
  ele.classList.remove(CLS_ACRDN_ROOT);
5497
5521
  ele.removeAttribute('style');
@@ -5848,11 +5872,13 @@ let Accordion = class Accordion extends Component {
5848
5872
  else {
5849
5873
  trgt.click();
5850
5874
  }
5875
+ e.preventDefault();
5851
5876
  break;
5852
5877
  case 'home':
5853
5878
  case 'end':
5854
5879
  clst = e.action === 'home' ? root.firstElementChild.children[0] : root.lastElementChild.children[0];
5855
5880
  clst.focus();
5881
+ e.preventDefault();
5856
5882
  break;
5857
5883
  }
5858
5884
  }
@@ -5867,12 +5893,10 @@ let Accordion = class Accordion extends Component {
5867
5893
  return header;
5868
5894
  }
5869
5895
  renderInnerItem(item, index) {
5870
- const innerEle = this.createElement('div', { className: CLS_ITEM$1 });
5871
- innerEle.id = getUniqueID('acrdn_item');
5872
- if (isNullOrUndefined(item.id)) {
5873
- item.id = innerEle.id;
5874
- }
5875
- attributes(innerEle, { 'aria-expanded': 'false', 'role': 'row' });
5896
+ const innerEle = this.createElement('div', {
5897
+ className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item'),
5898
+ attrs: { 'aria-expanded': 'false', 'role': 'row' }
5899
+ });
5876
5900
  if (this.headerTemplate) {
5877
5901
  const ctnEle = this.headerEleGenerate();
5878
5902
  const hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
@@ -6469,7 +6493,7 @@ let Accordion = class Accordion extends Component {
6469
6493
  }
6470
6494
  destroyItems() {
6471
6495
  this.restoreContent(null);
6472
- if (this.isReact) {
6496
+ if (this.isReact || this.isAngular || this.isVue) {
6473
6497
  this.clearTemplate();
6474
6498
  }
6475
6499
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM$1)).forEach((el) => {
@@ -7213,7 +7237,7 @@ let Tab = class Tab extends Component {
7213
7237
  this.isAdd = false;
7214
7238
  this.isIconAlone = false;
7215
7239
  this.draggableItems = [];
7216
- this.resizeContext = this.refreshActElePosition.bind(this);
7240
+ this.resizeContext = this.refreshActiveTabBorder.bind(this);
7217
7241
  /**
7218
7242
  * Contains the keyboard configuration of the Tab.
7219
7243
  */
@@ -7662,7 +7686,7 @@ let Tab = class Tab extends Component {
7662
7686
  trg.classList.remove(CLS_CLOSE_SHOW);
7663
7687
  }
7664
7688
  this.tbObj.refreshOverflow();
7665
- this.refreshActElePosition();
7689
+ this.refreshActiveTabBorder();
7666
7690
  }
7667
7691
  prevCtnAnimation(prev, current) {
7668
7692
  let animation;
@@ -7857,6 +7881,7 @@ let Tab = class Tab extends Component {
7857
7881
  }
7858
7882
  getContent(ele, cnt, callType, index) {
7859
7883
  let eleStr;
7884
+ cnt = isNullOrUndefined(cnt) ? "" : cnt;
7860
7885
  if (typeof cnt === 'string' || isNullOrUndefined(cnt.innerHTML)) {
7861
7886
  if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
7862
7887
  cnt = SanitizeHtmlHelper.sanitize(cnt);
@@ -8372,7 +8397,13 @@ let Tab = class Tab extends Component {
8372
8397
  break;
8373
8398
  }
8374
8399
  }
8375
- refreshActElePosition() {
8400
+ /**
8401
+ * Refresh the active tab border
8402
+ *
8403
+ * @returns {void}
8404
+ * @private
8405
+ */
8406
+ refreshActiveTabBorder() {
8376
8407
  const activeEle = select('.' + CLS_TB_ITEM + '.' + CLS_TB_POPUP + '.' + CLS_ACTIVE$1, this.element);
8377
8408
  if (!isNullOrUndefined(activeEle) && this.reorderActiveTab) {
8378
8409
  this.select(this.getEleIndex(activeEle));
@@ -9113,7 +9144,7 @@ let Tab = class Tab extends Component {
9113
9144
  this.setCloseButton(newProp.showCloseButton);
9114
9145
  break;
9115
9146
  case 'reorderActiveTab':
9116
- this.refreshActElePosition();
9147
+ this.refreshActiveTabBorder();
9117
9148
  break;
9118
9149
  case 'selectedItem':
9119
9150
  this.selectedItem = oldProp.selectedItem;
@@ -9128,7 +9159,7 @@ let Tab = class Tab extends Component {
9128
9159
  case 'overflowMode':
9129
9160
  this.tbObj.overflowMode = newProp.overflowMode;
9130
9161
  this.tbObj.dataBind();
9131
- this.refreshActElePosition();
9162
+ this.refreshActiveTabBorder();
9132
9163
  break;
9133
9164
  case 'heightAdjustMode':
9134
9165
  this.setContentHeight(false);