@syncfusion/ej2-navigations 30.2.4 → 30.2.7

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.
@@ -8297,11 +8297,11 @@ let Tab = class Tab extends Component {
8297
8297
  else if (this.isVertical() && (popIcon.offsetTop < lastChild.offsetTop + lastChild.offsetHeight)) {
8298
8298
  isOverflow = true;
8299
8299
  }
8300
- if (isOverflow) {
8300
+ if (isOverflow && !isNullOrUndefined(ele)) {
8301
8301
  ele.classList.add(CLS_TB_POPUP);
8302
8302
  this.tbPop.insertBefore(ele, selectAll('.' + CLS_TB_POPUP, this.tbPop)[0]);
8303
8303
  }
8304
- return true;
8304
+ return isOverflow;
8305
8305
  }
8306
8306
  popupHandler(target) {
8307
8307
  const ripEle = target.querySelector('.e-ripple-element');
@@ -8311,21 +8311,24 @@ let Tab = class Tab extends Component {
8311
8311
  }
8312
8312
  this.tbItem = selectAll('.' + CLS_TB_ITEMS + ' .' + CLS_TB_ITEM, this.hdrEle);
8313
8313
  const lastChild = this.tbItem[this.tbItem.length - 1];
8314
- if (this.tbItem.length !== 0) {
8314
+ if (this.tbItem.length >= 0) {
8315
8315
  target.classList.remove(CLS_TB_POPUP);
8316
8316
  target.removeAttribute('style');
8317
8317
  this.tbItems.appendChild(target);
8318
8318
  this.actEleId = target.id;
8319
8319
  if (this.checkPopupOverflow(lastChild)) {
8320
- let prevEle = this.tbItems.lastChild.previousElementSibling;
8321
- prevEle = (prevEle && prevEle.classList.contains(CLS_INDICATOR) ? prevEle.previousElementSibling : prevEle);
8322
- if (prevEle) {
8323
- this.checkPopupOverflow(prevEle);
8320
+ for (let i = 0; i < this.tbItems.children.length; i++) {
8321
+ let prevEle = this.tbItems.lastChild.previousElementSibling;
8322
+ prevEle = (prevEle && prevEle.classList.contains(CLS_INDICATOR) ? prevEle.previousElementSibling : prevEle);
8323
+ if (!this.checkPopupOverflow(prevEle ? prevEle : target)) {
8324
+ break;
8325
+ }
8324
8326
  }
8325
8327
  }
8326
8328
  this.isPopup = true;
8327
8329
  }
8328
- return selectAll('.' + CLS_TB_ITEM, this.tbItems).length - 1;
8330
+ const tabItemsLength = selectAll('.' + CLS_TB_ITEM, this.tbItems).length;
8331
+ return tabItemsLength > 0 ? tabItemsLength - 1 : this.getEleIndex(target);
8329
8332
  }
8330
8333
  setCloseButton(val) {
8331
8334
  const trg = select('.' + CLS_HEADER$1, this.element);
@@ -9876,6 +9879,7 @@ let Tab = class Tab extends Component {
9876
9879
  */
9877
9880
  getItemIndex(tabItemId) {
9878
9881
  let tabIndex;
9882
+ this.tbItem = selectAll('.' + CLS_TB_ITEM, this.getTabHeader());
9879
9883
  for (let i = 0; i < this.tbItem.length; i++) {
9880
9884
  const value = this.tbItem[i].getAttribute('data-id');
9881
9885
  if (tabItemId === value) {
@@ -10413,6 +10417,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10413
10417
  this.changeDataSource = false;
10414
10418
  this.hasTemplate = false;
10415
10419
  this.isFirstRender = false;
10420
+ this.batchParentNode = new Set();
10416
10421
  // Specifies whether the node is dropped or not
10417
10422
  this.isNodeDropped = false;
10418
10423
  this.isInteracted = false;
@@ -11362,6 +11367,10 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11362
11367
  }
11363
11368
  doCheckBoxAction(nodes, doCheck) {
11364
11369
  if (!isNullOrUndefined(nodes)) {
11370
+ if (nodes.length > 1 && this.autoCheck) {
11371
+ this.isBatchMode = true;
11372
+ this.batchParentNode = new Set();
11373
+ }
11365
11374
  nodes.reverse();
11366
11375
  for (let len = nodes.length - 1; len >= 0; len--) {
11367
11376
  const liEle = this.getElement(nodes[parseInt(len.toString(), 10)]);
@@ -11404,6 +11413,16 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11404
11413
  const checkBox = select('.' + PARENTITEM + ' .' + CHECKBOXWRAP, liEle);
11405
11414
  this.validateCheckNode(checkBox, !doCheck, liEle, null);
11406
11415
  }
11416
+ if (this.isBatchMode && this.autoCheck) {
11417
+ this.isBatchMode = false;
11418
+ Array.from(this.batchParentNode).forEach((parentId) => {
11419
+ const parentLi = this.getElement(parentId);
11420
+ if (parentLi) {
11421
+ this.ensureParentCheckState(parentLi);
11422
+ }
11423
+ });
11424
+ this.batchParentNode.clear();
11425
+ }
11407
11426
  }
11408
11427
  else {
11409
11428
  const checkBoxes = selectAll('.' + CHECKBOXWRAP, this.element);
@@ -12819,7 +12838,16 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12819
12838
  if (this.autoCheck) {
12820
12839
  this.ensureChildCheckState(li);
12821
12840
  this.updateOldCheckedData([this.getNodeData(li)]);
12822
- this.ensureParentCheckState(closest(closest(li, '.' + PARENTITEM), '.' + LISTITEM));
12841
+ const parentLi = closest(closest(li, '.' + PARENTITEM), '.' + LISTITEM);
12842
+ if (this.isBatchMode) {
12843
+ const parentId = !isNullOrUndefined(parentLi) ? parentLi.getAttribute('data-uid') : null;
12844
+ if (parentId) {
12845
+ this.batchParentNode.add(parentId);
12846
+ }
12847
+ }
12848
+ else {
12849
+ this.ensureParentCheckState(parentLi);
12850
+ }
12823
12851
  let doCheck;
12824
12852
  if (eventArgs.action === 'check') {
12825
12853
  doCheck = true;