@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
|
@@ -2545,21 +2545,26 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
2545
2545
|
* This method is used to set the menu item in the Menu based on the argument.
|
|
2546
2546
|
*
|
|
2547
2547
|
* @param {MenuItem} item - item need to be updated.
|
|
2548
|
-
* @param {string} id - id to be passed to update the item.
|
|
2548
|
+
* @param {string} id - id / text to be passed to update the item.
|
|
2549
2549
|
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
2550
2550
|
* @returns {void}
|
|
2551
2551
|
*/
|
|
2552
2552
|
MenuBase.prototype.setItem = function (item, id, isUniqueId) {
|
|
2553
|
-
var idx
|
|
2554
|
-
|
|
2555
|
-
|
|
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);
|
|
2556
2561
|
var newItem = this.getItem(navIdx);
|
|
2557
|
-
newItem.
|
|
2558
|
-
newItem.
|
|
2559
|
-
newItem.text = item.text;
|
|
2560
|
-
newItem.url = item.url;
|
|
2561
|
-
newItem.separator = item.separator;
|
|
2562
|
-
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;
|
|
2563
2568
|
};
|
|
2564
2569
|
MenuBase.prototype.getItem = function (navIdx) {
|
|
2565
2570
|
navIdx = navIdx.slice();
|
|
@@ -3436,7 +3441,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3436
3441
|
*/
|
|
3437
3442
|
Toolbar.prototype.destroy = function () {
|
|
3438
3443
|
var _this = this;
|
|
3439
|
-
if (this.isReact) {
|
|
3444
|
+
if (this.isReact || this.isAngular) {
|
|
3440
3445
|
this.clearTemplate();
|
|
3441
3446
|
}
|
|
3442
3447
|
var btnItems = this.element.querySelectorAll('.e-control.e-btn');
|
|
@@ -3445,20 +3450,28 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3445
3450
|
el.ej2_instances[0].destroy();
|
|
3446
3451
|
}
|
|
3447
3452
|
});
|
|
3448
|
-
_super.prototype.destroy.call(this);
|
|
3449
3453
|
this.unwireEvents();
|
|
3450
3454
|
this.tempId.forEach(function (ele) {
|
|
3451
3455
|
if (!isNullOrUndefined(_this.element.querySelector(ele))) {
|
|
3452
3456
|
document.body.appendChild(_this.element.querySelector(ele)).style.display = 'none';
|
|
3453
3457
|
}
|
|
3454
3458
|
});
|
|
3459
|
+
this.destroyItems();
|
|
3455
3460
|
while (this.element.lastElementChild) {
|
|
3456
3461
|
this.element.removeChild(this.element.lastElementChild);
|
|
3457
3462
|
}
|
|
3458
3463
|
if (this.trgtEle) {
|
|
3459
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;
|
|
3460
3474
|
}
|
|
3461
|
-
this.clearProperty();
|
|
3462
3475
|
this.popObj = null;
|
|
3463
3476
|
this.tbarAlign = null;
|
|
3464
3477
|
this.remove(this.element, 'e-toolpop');
|
|
@@ -3469,6 +3482,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3469
3482
|
['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach(function (attrb) {
|
|
3470
3483
|
return _this.element.removeAttribute(attrb);
|
|
3471
3484
|
});
|
|
3485
|
+
_super.prototype.destroy.call(this);
|
|
3472
3486
|
};
|
|
3473
3487
|
/**
|
|
3474
3488
|
* Initialize the event handler
|
|
@@ -3558,8 +3572,8 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3558
3572
|
if (this.element) {
|
|
3559
3573
|
[].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach(function (el) { detach(el); });
|
|
3560
3574
|
}
|
|
3561
|
-
var tbarItems = this.element.querySelector('.' + CLS_ITEMS);
|
|
3562
3575
|
if (this.tbarAlign) {
|
|
3576
|
+
var tbarItems = this.element.querySelector('.' + CLS_ITEMS);
|
|
3563
3577
|
[].slice.call(tbarItems.children).forEach(function (el) {
|
|
3564
3578
|
detach(el);
|
|
3565
3579
|
});
|
|
@@ -3643,6 +3657,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3643
3657
|
case 'end':
|
|
3644
3658
|
if (clst) {
|
|
3645
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
|
+
}
|
|
3646
3664
|
if (popupCheck) {
|
|
3647
3665
|
if (isVisible(this.popObj.element)) {
|
|
3648
3666
|
nodes = [].slice.call(popupCheck.children);
|
|
@@ -3655,7 +3673,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3655
3673
|
}
|
|
3656
3674
|
}
|
|
3657
3675
|
else {
|
|
3658
|
-
nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);
|
|
3676
|
+
nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
|
|
3659
3677
|
if (e.action === 'home') {
|
|
3660
3678
|
ele = nodes[0];
|
|
3661
3679
|
}
|
|
@@ -5199,7 +5217,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
5199
5217
|
};
|
|
5200
5218
|
Toolbar.prototype.itemsRerender = function (newProp) {
|
|
5201
5219
|
this.items = this.tbarItemsCol;
|
|
5202
|
-
if (this.isReact) {
|
|
5220
|
+
if (this.isReact || this.isAngular) {
|
|
5203
5221
|
this.clearTemplate();
|
|
5204
5222
|
}
|
|
5205
5223
|
this.destroyMode();
|
|
@@ -5668,7 +5686,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
|
|
|
5668
5686
|
*/
|
|
5669
5687
|
Accordion.prototype.destroy = function () {
|
|
5670
5688
|
var _this = this;
|
|
5671
|
-
if (this.isReact) {
|
|
5689
|
+
if (this.isReact || this.isAngular || this.isVue) {
|
|
5672
5690
|
this.clearTemplate();
|
|
5673
5691
|
}
|
|
5674
5692
|
var ele = this.element;
|
|
@@ -5680,9 +5698,11 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
|
|
|
5680
5698
|
ele.removeChild(el);
|
|
5681
5699
|
});
|
|
5682
5700
|
if (this.trgtEle) {
|
|
5701
|
+
this.trgtEle = null;
|
|
5683
5702
|
while (this.ctrlTem.firstElementChild) {
|
|
5684
5703
|
ele.appendChild(this.ctrlTem.firstElementChild);
|
|
5685
5704
|
}
|
|
5705
|
+
this.ctrlTem = null;
|
|
5686
5706
|
}
|
|
5687
5707
|
ele.classList.remove(CLS_ACRDN_ROOT);
|
|
5688
5708
|
ele.removeAttribute('style');
|
|
@@ -6043,11 +6063,13 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
|
|
|
6043
6063
|
else {
|
|
6044
6064
|
trgt.click();
|
|
6045
6065
|
}
|
|
6066
|
+
e.preventDefault();
|
|
6046
6067
|
break;
|
|
6047
6068
|
case 'home':
|
|
6048
6069
|
case 'end':
|
|
6049
6070
|
clst = e.action === 'home' ? root.firstElementChild.children[0] : root.lastElementChild.children[0];
|
|
6050
6071
|
clst.focus();
|
|
6072
|
+
e.preventDefault();
|
|
6051
6073
|
break;
|
|
6052
6074
|
}
|
|
6053
6075
|
};
|
|
@@ -6062,12 +6084,10 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
|
|
|
6062
6084
|
return header;
|
|
6063
6085
|
};
|
|
6064
6086
|
Accordion.prototype.renderInnerItem = function (item, index) {
|
|
6065
|
-
var innerEle = this.createElement('div', {
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
}
|
|
6070
|
-
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
|
+
});
|
|
6071
6091
|
if (this.headerTemplate) {
|
|
6072
6092
|
var ctnEle = this.headerEleGenerate();
|
|
6073
6093
|
var hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
|
|
@@ -6671,7 +6691,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
|
|
|
6671
6691
|
};
|
|
6672
6692
|
Accordion.prototype.destroyItems = function () {
|
|
6673
6693
|
this.restoreContent(null);
|
|
6674
|
-
if (this.isReact) {
|
|
6694
|
+
if (this.isReact || this.isAngular || this.isVue) {
|
|
6675
6695
|
this.clearTemplate();
|
|
6676
6696
|
}
|
|
6677
6697
|
[].slice.call(this.element.querySelectorAll('.' + CLS_ITEM$1)).forEach(function (el) {
|
|
@@ -8136,6 +8156,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
|
|
|
8136
8156
|
};
|
|
8137
8157
|
Tab.prototype.getContent = function (ele, cnt, callType, index) {
|
|
8138
8158
|
var eleStr;
|
|
8159
|
+
cnt = isNullOrUndefined(cnt) ? "" : cnt;
|
|
8139
8160
|
if (typeof cnt === 'string' || isNullOrUndefined(cnt.innerHTML)) {
|
|
8140
8161
|
if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
|
|
8141
8162
|
cnt = SanitizeHtmlHelper.sanitize(cnt);
|