@syncfusion/ej2-navigations 19.4.47 → 19.4.53

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 (46) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/dist/ej2-navigations.umd.min.js +2 -2
  4. package/dist/ej2-navigations.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-navigations.es2015.js +50 -29
  6. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  7. package/dist/es6/ej2-navigations.es5.js +49 -28
  8. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  9. package/dist/global/ej2-navigations.min.js +2 -2
  10. package/dist/global/ej2-navigations.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +11 -11
  13. package/src/accordion/accordion.js +13 -11
  14. package/src/common/menu-base.d.ts +1 -1
  15. package/src/common/menu-base.js +13 -10
  16. package/src/sidebar/sidebar.d.ts +1 -0
  17. package/src/sidebar/sidebar.js +3 -1
  18. package/src/tab/tab.js +1 -0
  19. package/src/toolbar/toolbar.js +19 -6
  20. package/styles/bootstrap-dark.css +5 -2
  21. package/styles/bootstrap.css +5 -2
  22. package/styles/bootstrap4.css +5 -2
  23. package/styles/bootstrap5-dark.css +5 -2
  24. package/styles/bootstrap5.css +5 -2
  25. package/styles/fabric-dark.css +5 -2
  26. package/styles/fabric.css +5 -2
  27. package/styles/highcontrast-light.css +5 -2
  28. package/styles/highcontrast.css +5 -2
  29. package/styles/material-dark.css +5 -2
  30. package/styles/material.css +5 -2
  31. package/styles/tailwind-dark.css +5 -2
  32. package/styles/tailwind.css +5 -2
  33. package/styles/toolbar/_layout.scss +4 -2
  34. package/styles/toolbar/bootstrap-dark.css +5 -2
  35. package/styles/toolbar/bootstrap.css +5 -2
  36. package/styles/toolbar/bootstrap4.css +5 -2
  37. package/styles/toolbar/bootstrap5-dark.css +5 -2
  38. package/styles/toolbar/bootstrap5.css +5 -2
  39. package/styles/toolbar/fabric-dark.css +5 -2
  40. package/styles/toolbar/fabric.css +5 -2
  41. package/styles/toolbar/highcontrast-light.css +5 -2
  42. package/styles/toolbar/highcontrast.css +5 -2
  43. package/styles/toolbar/material-dark.css +5 -2
  44. package/styles/toolbar/material.css +5 -2
  45. package/styles/toolbar/tailwind-dark.css +5 -2
  46. package/styles/toolbar/tailwind.css +5 -2
@@ -2449,21 +2449,24 @@ let MenuBase = class MenuBase extends Component {
2449
2449
  * This method is used to set the menu item in the Menu based on the argument.
2450
2450
  *
2451
2451
  * @param {MenuItem} item - item need to be updated.
2452
- * @param {string} id - id to be passed to update the item.
2452
+ * @param {string} id - id / text to be passed to update the item.
2453
2453
  * @param {boolean} isUniqueId - Set `true` if it is a unique id.
2454
2454
  * @returns {void}
2455
2455
  */
2456
2456
  setItem(item, id, isUniqueId) {
2457
- const idx = id ? id : item.id;
2458
- const isText = (isUniqueId === false) ? false : true;
2459
- 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);
2460
2465
  const newItem = this.getItem(navIdx);
2461
- newItem.iconCss = item.iconCss;
2462
- newItem.id = item.id;
2463
- newItem.text = item.text;
2464
- newItem.url = item.url;
2465
- newItem.separator = item.separator;
2466
- 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;
2467
2470
  }
2468
2471
  getItem(navIdx) {
2469
2472
  navIdx = navIdx.slice();
@@ -3300,7 +3303,7 @@ let Toolbar = class Toolbar extends Component {
3300
3303
  * @returns {void}.
3301
3304
  */
3302
3305
  destroy() {
3303
- if (this.isReact) {
3306
+ if (this.isReact || this.isAngular) {
3304
3307
  this.clearTemplate();
3305
3308
  }
3306
3309
  const btnItems = this.element.querySelectorAll('.e-control.e-btn');
@@ -3309,20 +3312,28 @@ let Toolbar = class Toolbar extends Component {
3309
3312
  el.ej2_instances[0].destroy();
3310
3313
  }
3311
3314
  });
3312
- super.destroy();
3313
3315
  this.unwireEvents();
3314
3316
  this.tempId.forEach((ele) => {
3315
3317
  if (!isNullOrUndefined(this.element.querySelector(ele))) {
3316
3318
  document.body.appendChild(this.element.querySelector(ele)).style.display = 'none';
3317
3319
  }
3318
3320
  });
3321
+ this.destroyItems();
3319
3322
  while (this.element.lastElementChild) {
3320
3323
  this.element.removeChild(this.element.lastElementChild);
3321
3324
  }
3322
3325
  if (this.trgtEle) {
3323
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;
3324
3336
  }
3325
- this.clearProperty();
3326
3337
  this.popObj = null;
3327
3338
  this.tbarAlign = null;
3328
3339
  this.remove(this.element, 'e-toolpop');
@@ -3331,6 +3342,7 @@ let Toolbar = class Toolbar extends Component {
3331
3342
  }
3332
3343
  this.element.removeAttribute('style');
3333
3344
  ['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach((attrb) => this.element.removeAttribute(attrb));
3345
+ super.destroy();
3334
3346
  }
3335
3347
  /**
3336
3348
  * Initialize the event handler
@@ -3420,8 +3432,8 @@ let Toolbar = class Toolbar extends Component {
3420
3432
  if (this.element) {
3421
3433
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach((el) => { detach(el); });
3422
3434
  }
3423
- const tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3424
3435
  if (this.tbarAlign) {
3436
+ const tbarItems = this.element.querySelector('.' + CLS_ITEMS);
3425
3437
  [].slice.call(tbarItems.children).forEach((el) => {
3426
3438
  detach(el);
3427
3439
  });
@@ -3504,7 +3516,11 @@ let Toolbar = class Toolbar extends Component {
3504
3516
  case 'home':
3505
3517
  case 'end':
3506
3518
  if (clst) {
3507
- 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
+ }
3508
3524
  if (popupCheck) {
3509
3525
  if (isVisible(this.popObj.element)) {
3510
3526
  nodes = [].slice.call(popupCheck.children);
@@ -3517,7 +3533,7 @@ let Toolbar = class Toolbar extends Component {
3517
3533
  }
3518
3534
  }
3519
3535
  else {
3520
- nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);
3536
+ nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3521
3537
  if (e.action === 'home') {
3522
3538
  ele = nodes[0];
3523
3539
  }
@@ -5047,7 +5063,7 @@ let Toolbar = class Toolbar extends Component {
5047
5063
  }
5048
5064
  itemsRerender(newProp) {
5049
5065
  this.items = this.tbarItemsCol;
5050
- if (this.isReact) {
5066
+ if (this.isReact || this.isAngular) {
5051
5067
  this.clearTemplate();
5052
5068
  }
5053
5069
  this.destroyMode();
@@ -5483,7 +5499,7 @@ let Accordion = class Accordion extends Component {
5483
5499
  * @returns {void}
5484
5500
  */
5485
5501
  destroy() {
5486
- if (this.isReact) {
5502
+ if (this.isReact || this.isAngular || this.isVue) {
5487
5503
  this.clearTemplate();
5488
5504
  }
5489
5505
  const ele = this.element;
@@ -5495,9 +5511,11 @@ let Accordion = class Accordion extends Component {
5495
5511
  ele.removeChild(el);
5496
5512
  });
5497
5513
  if (this.trgtEle) {
5514
+ this.trgtEle = null;
5498
5515
  while (this.ctrlTem.firstElementChild) {
5499
5516
  ele.appendChild(this.ctrlTem.firstElementChild);
5500
5517
  }
5518
+ this.ctrlTem = null;
5501
5519
  }
5502
5520
  ele.classList.remove(CLS_ACRDN_ROOT);
5503
5521
  ele.removeAttribute('style');
@@ -5854,11 +5872,13 @@ let Accordion = class Accordion extends Component {
5854
5872
  else {
5855
5873
  trgt.click();
5856
5874
  }
5875
+ e.preventDefault();
5857
5876
  break;
5858
5877
  case 'home':
5859
5878
  case 'end':
5860
5879
  clst = e.action === 'home' ? root.firstElementChild.children[0] : root.lastElementChild.children[0];
5861
5880
  clst.focus();
5881
+ e.preventDefault();
5862
5882
  break;
5863
5883
  }
5864
5884
  }
@@ -5866,19 +5886,17 @@ let Accordion = class Accordion extends Component {
5866
5886
  const header = this.createElement('div', { className: CLS_HEADER, id: getUniqueID('acrdn_header') });
5867
5887
  const items = this.getItems();
5868
5888
  const ariaAttr = {
5869
- 'tabindex': '0', 'role': 'heading', 'aria-selected': 'false', 'aria-label': 'collapsed',
5889
+ 'tabindex': '0', 'role': 'heading', 'aria-label': 'collapsed',
5870
5890
  'aria-disabled': 'false', 'aria-level': items.length.toString()
5871
5891
  };
5872
5892
  attributes(header, ariaAttr);
5873
5893
  return header;
5874
5894
  }
5875
5895
  renderInnerItem(item, index) {
5876
- const innerEle = this.createElement('div', { className: CLS_ITEM$1 });
5877
- innerEle.id = getUniqueID('acrdn_item');
5878
- if (isNullOrUndefined(item.id)) {
5879
- item.id = innerEle.id;
5880
- }
5881
- 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
+ });
5882
5900
  if (this.headerTemplate) {
5883
5901
  const ctnEle = this.headerEleGenerate();
5884
5902
  const hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
@@ -6120,7 +6138,7 @@ let Accordion = class Accordion extends Component {
6120
6138
  this.add(trgtItemEle, CLS_ACTIVE);
6121
6139
  trgt.setAttribute('aria-hidden', 'false');
6122
6140
  attributes(trgtItemEle, { 'aria-expanded': 'true' });
6123
- attributes(trgt.previousElementSibling, { 'aria-selected': 'true', 'aria-label': 'expanded' });
6141
+ attributes(trgt.previousElementSibling, { 'aria-label': 'expanded' });
6124
6142
  icon.classList.remove(CLS_TOGANIMATE);
6125
6143
  this.trigger('expanded', eventArgs);
6126
6144
  }
@@ -6235,7 +6253,7 @@ let Accordion = class Accordion extends Component {
6235
6253
  this.remove(trgtItemEle, CLS_ACTIVE);
6236
6254
  trgt.setAttribute('aria-hidden', 'true');
6237
6255
  attributes(trgtItemEle, { 'aria-expanded': 'false' });
6238
- attributes(trgt.previousElementSibling, { 'aria-selected': 'false', 'aria-label': 'collapsed' });
6256
+ attributes(trgt.previousElementSibling, { 'aria-label': 'collapsed' });
6239
6257
  this.trigger('expanded', eventArgs);
6240
6258
  }
6241
6259
  }
@@ -6475,7 +6493,7 @@ let Accordion = class Accordion extends Component {
6475
6493
  }
6476
6494
  destroyItems() {
6477
6495
  this.restoreContent(null);
6478
- if (this.isReact) {
6496
+ if (this.isReact || this.isAngular || this.isVue) {
6479
6497
  this.clearTemplate();
6480
6498
  }
6481
6499
  [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM$1)).forEach((el) => {
@@ -7863,6 +7881,7 @@ let Tab = class Tab extends Component {
7863
7881
  }
7864
7882
  getContent(ele, cnt, callType, index) {
7865
7883
  let eleStr;
7884
+ cnt = isNullOrUndefined(cnt) ? "" : cnt;
7866
7885
  if (typeof cnt === 'string' || isNullOrUndefined(cnt.innerHTML)) {
7867
7886
  if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
7868
7887
  cnt = SanitizeHtmlHelper.sanitize(cnt);
@@ -14395,6 +14414,7 @@ let Sidebar = class Sidebar extends Component {
14395
14414
  }
14396
14415
  if (this.isOpen) {
14397
14416
  this.show();
14417
+ this.firstRender = true;
14398
14418
  }
14399
14419
  else {
14400
14420
  this.setMediaQuery();
@@ -14505,9 +14525,10 @@ let Sidebar = class Sidebar extends Component {
14505
14525
  }
14506
14526
  transitionEnd(e) {
14507
14527
  this.setDock();
14508
- if (!isNullOrUndefined(e)) {
14528
+ if (!isNullOrUndefined(e) && !this.firstRender) {
14509
14529
  this.triggerChange();
14510
14530
  }
14531
+ this.firstRender = false;
14511
14532
  EventHandler.remove(this.element, 'transitionend', this.transitionEnd);
14512
14533
  }
14513
14534
  destroyBackDrop() {