@syncfusion/ej2-navigations 19.4.47 → 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.
- package/CHANGELOG.md +26 -0
- package/dist/ej2-navigations.umd.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +46 -25
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +45 -24
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +2 -2
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/accordion/accordion.js +10 -8
- package/src/common/menu-base.d.ts +1 -1
- package/src/common/menu-base.js +15 -10
- package/src/tab/tab.js +1 -0
- package/src/toolbar/toolbar.js +19 -6
|
@@ -2449,21 +2449,26 @@ 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
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
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.
|
|
2462
|
-
newItem.
|
|
2463
|
-
newItem.text = item.text;
|
|
2464
|
-
newItem.url = item.url;
|
|
2465
|
-
newItem.separator = item.separator;
|
|
2466
|
-
newItem.items = item.items;
|
|
2466
|
+
newItem.id = item.id || newItem.id;
|
|
2467
|
+
newItem.iconCss = item.iconCss || newItem.iconCss;
|
|
2468
|
+
newItem.text = item.text || newItem.text;
|
|
2469
|
+
newItem.url = item.url || newItem.url;
|
|
2470
|
+
newItem.separator = item.separator || newItem.separator;
|
|
2471
|
+
newItem.items = item.items || newItem.items;
|
|
2467
2472
|
}
|
|
2468
2473
|
getItem(navIdx) {
|
|
2469
2474
|
navIdx = navIdx.slice();
|
|
@@ -3300,7 +3305,7 @@ let Toolbar = class Toolbar extends Component {
|
|
|
3300
3305
|
* @returns {void}.
|
|
3301
3306
|
*/
|
|
3302
3307
|
destroy() {
|
|
3303
|
-
if (this.isReact) {
|
|
3308
|
+
if (this.isReact || this.isAngular) {
|
|
3304
3309
|
this.clearTemplate();
|
|
3305
3310
|
}
|
|
3306
3311
|
const btnItems = this.element.querySelectorAll('.e-control.e-btn');
|
|
@@ -3309,20 +3314,28 @@ let Toolbar = class Toolbar extends Component {
|
|
|
3309
3314
|
el.ej2_instances[0].destroy();
|
|
3310
3315
|
}
|
|
3311
3316
|
});
|
|
3312
|
-
super.destroy();
|
|
3313
3317
|
this.unwireEvents();
|
|
3314
3318
|
this.tempId.forEach((ele) => {
|
|
3315
3319
|
if (!isNullOrUndefined(this.element.querySelector(ele))) {
|
|
3316
3320
|
document.body.appendChild(this.element.querySelector(ele)).style.display = 'none';
|
|
3317
3321
|
}
|
|
3318
3322
|
});
|
|
3323
|
+
this.destroyItems();
|
|
3319
3324
|
while (this.element.lastElementChild) {
|
|
3320
3325
|
this.element.removeChild(this.element.lastElementChild);
|
|
3321
3326
|
}
|
|
3322
3327
|
if (this.trgtEle) {
|
|
3323
3328
|
this.element.appendChild(this.ctrlTem);
|
|
3329
|
+
this.trgtEle = null;
|
|
3330
|
+
this.ctrlTem = null;
|
|
3331
|
+
}
|
|
3332
|
+
if (this.popObj) {
|
|
3333
|
+
this.popObj.destroy();
|
|
3334
|
+
detach(this.popObj.element);
|
|
3335
|
+
}
|
|
3336
|
+
if (this.activeEle) {
|
|
3337
|
+
this.activeEle = null;
|
|
3324
3338
|
}
|
|
3325
|
-
this.clearProperty();
|
|
3326
3339
|
this.popObj = null;
|
|
3327
3340
|
this.tbarAlign = null;
|
|
3328
3341
|
this.remove(this.element, 'e-toolpop');
|
|
@@ -3331,6 +3344,7 @@ let Toolbar = class Toolbar extends Component {
|
|
|
3331
3344
|
}
|
|
3332
3345
|
this.element.removeAttribute('style');
|
|
3333
3346
|
['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach((attrb) => this.element.removeAttribute(attrb));
|
|
3347
|
+
super.destroy();
|
|
3334
3348
|
}
|
|
3335
3349
|
/**
|
|
3336
3350
|
* Initialize the event handler
|
|
@@ -3420,8 +3434,8 @@ let Toolbar = class Toolbar extends Component {
|
|
|
3420
3434
|
if (this.element) {
|
|
3421
3435
|
[].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach((el) => { detach(el); });
|
|
3422
3436
|
}
|
|
3423
|
-
const tbarItems = this.element.querySelector('.' + CLS_ITEMS);
|
|
3424
3437
|
if (this.tbarAlign) {
|
|
3438
|
+
const tbarItems = this.element.querySelector('.' + CLS_ITEMS);
|
|
3425
3439
|
[].slice.call(tbarItems.children).forEach((el) => {
|
|
3426
3440
|
detach(el);
|
|
3427
3441
|
});
|
|
@@ -3504,7 +3518,11 @@ let Toolbar = class Toolbar extends Component {
|
|
|
3504
3518
|
case 'home':
|
|
3505
3519
|
case 'end':
|
|
3506
3520
|
if (clst) {
|
|
3507
|
-
|
|
3521
|
+
let popupCheck = closest(clst, '.e-popup');
|
|
3522
|
+
const extendedPopup = this.element.querySelector('.' + CLS_EXTENDABLECLASS);
|
|
3523
|
+
if (this.overflowMode === 'Extended' && extendedPopup && extendedPopup.classList.contains('e-popup-open')) {
|
|
3524
|
+
popupCheck = e.action === 'end' ? extendedPopup : null;
|
|
3525
|
+
}
|
|
3508
3526
|
if (popupCheck) {
|
|
3509
3527
|
if (isVisible(this.popObj.element)) {
|
|
3510
3528
|
nodes = [].slice.call(popupCheck.children);
|
|
@@ -3517,7 +3535,7 @@ let Toolbar = class Toolbar extends Component {
|
|
|
3517
3535
|
}
|
|
3518
3536
|
}
|
|
3519
3537
|
else {
|
|
3520
|
-
nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);
|
|
3538
|
+
nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
|
|
3521
3539
|
if (e.action === 'home') {
|
|
3522
3540
|
ele = nodes[0];
|
|
3523
3541
|
}
|
|
@@ -5047,7 +5065,7 @@ let Toolbar = class Toolbar extends Component {
|
|
|
5047
5065
|
}
|
|
5048
5066
|
itemsRerender(newProp) {
|
|
5049
5067
|
this.items = this.tbarItemsCol;
|
|
5050
|
-
if (this.isReact) {
|
|
5068
|
+
if (this.isReact || this.isAngular) {
|
|
5051
5069
|
this.clearTemplate();
|
|
5052
5070
|
}
|
|
5053
5071
|
this.destroyMode();
|
|
@@ -5483,7 +5501,7 @@ let Accordion = class Accordion extends Component {
|
|
|
5483
5501
|
* @returns {void}
|
|
5484
5502
|
*/
|
|
5485
5503
|
destroy() {
|
|
5486
|
-
if (this.isReact) {
|
|
5504
|
+
if (this.isReact || this.isAngular || this.isVue) {
|
|
5487
5505
|
this.clearTemplate();
|
|
5488
5506
|
}
|
|
5489
5507
|
const ele = this.element;
|
|
@@ -5495,9 +5513,11 @@ let Accordion = class Accordion extends Component {
|
|
|
5495
5513
|
ele.removeChild(el);
|
|
5496
5514
|
});
|
|
5497
5515
|
if (this.trgtEle) {
|
|
5516
|
+
this.trgtEle = null;
|
|
5498
5517
|
while (this.ctrlTem.firstElementChild) {
|
|
5499
5518
|
ele.appendChild(this.ctrlTem.firstElementChild);
|
|
5500
5519
|
}
|
|
5520
|
+
this.ctrlTem = null;
|
|
5501
5521
|
}
|
|
5502
5522
|
ele.classList.remove(CLS_ACRDN_ROOT);
|
|
5503
5523
|
ele.removeAttribute('style');
|
|
@@ -5854,11 +5874,13 @@ let Accordion = class Accordion extends Component {
|
|
|
5854
5874
|
else {
|
|
5855
5875
|
trgt.click();
|
|
5856
5876
|
}
|
|
5877
|
+
e.preventDefault();
|
|
5857
5878
|
break;
|
|
5858
5879
|
case 'home':
|
|
5859
5880
|
case 'end':
|
|
5860
5881
|
clst = e.action === 'home' ? root.firstElementChild.children[0] : root.lastElementChild.children[0];
|
|
5861
5882
|
clst.focus();
|
|
5883
|
+
e.preventDefault();
|
|
5862
5884
|
break;
|
|
5863
5885
|
}
|
|
5864
5886
|
}
|
|
@@ -5873,12 +5895,10 @@ let Accordion = class Accordion extends Component {
|
|
|
5873
5895
|
return header;
|
|
5874
5896
|
}
|
|
5875
5897
|
renderInnerItem(item, index) {
|
|
5876
|
-
const innerEle = this.createElement('div', {
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
}
|
|
5881
|
-
attributes(innerEle, { 'aria-expanded': 'false', 'role': 'row' });
|
|
5898
|
+
const innerEle = this.createElement('div', {
|
|
5899
|
+
className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item'),
|
|
5900
|
+
attrs: { 'aria-expanded': 'false', 'role': 'row' }
|
|
5901
|
+
});
|
|
5882
5902
|
if (this.headerTemplate) {
|
|
5883
5903
|
const ctnEle = this.headerEleGenerate();
|
|
5884
5904
|
const hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
|
|
@@ -6475,7 +6495,7 @@ let Accordion = class Accordion extends Component {
|
|
|
6475
6495
|
}
|
|
6476
6496
|
destroyItems() {
|
|
6477
6497
|
this.restoreContent(null);
|
|
6478
|
-
if (this.isReact) {
|
|
6498
|
+
if (this.isReact || this.isAngular || this.isVue) {
|
|
6479
6499
|
this.clearTemplate();
|
|
6480
6500
|
}
|
|
6481
6501
|
[].slice.call(this.element.querySelectorAll('.' + CLS_ITEM$1)).forEach((el) => {
|
|
@@ -7863,6 +7883,7 @@ let Tab = class Tab extends Component {
|
|
|
7863
7883
|
}
|
|
7864
7884
|
getContent(ele, cnt, callType, index) {
|
|
7865
7885
|
let eleStr;
|
|
7886
|
+
cnt = isNullOrUndefined(cnt) ? "" : cnt;
|
|
7866
7887
|
if (typeof cnt === 'string' || isNullOrUndefined(cnt.innerHTML)) {
|
|
7867
7888
|
if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
|
|
7868
7889
|
cnt = SanitizeHtmlHelper.sanitize(cnt);
|