@syncfusion/ej2-navigations 29.2.4 → 29.2.5

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.
@@ -2364,7 +2364,7 @@ let MenuBase = class MenuBase extends Component {
2364
2364
  args.item.setAttribute('aria-expanded', 'false');
2365
2365
  args.item.classList.add('e-menu-caret-icon');
2366
2366
  }
2367
- if (this.isMenu && this.template) {
2367
+ if (this.template) {
2368
2368
  args.item.setAttribute('id', args.curData[args.fields.id].toString());
2369
2369
  args.item.removeAttribute('data-uid');
2370
2370
  if (args.item.classList.contains('e-level-1')) {
@@ -11789,8 +11789,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11789
11789
  const rippleIcons = select('.' + ICON, li);
11790
11790
  this.removeHover();
11791
11791
  this.setFocusElement(li);
11792
- if (this.showCheckBox && !li.classList.contains('e-disable')) {
11793
- const checkWrapper = closest(target, '.' + CHECKBOXWRAP);
11792
+ const isExpandCollapseIcon = classList.contains(EXPANDABLE) || classList.contains(COLLAPSIBLE);
11793
+ if (this.showCheckBox && !li.classList.contains('e-disable') && !isExpandCollapseIcon) {
11794
+ const checkWrapper = this.checkOnClick ? select('.' + CHECKBOXWRAP, li) : closest(target, '.' + CHECKBOXWRAP);
11794
11795
  if (!isNullOrUndefined(checkWrapper)) {
11795
11796
  const checkElement = select('.' + CHECKBOXFRAME, checkWrapper);
11796
11797
  this.validateCheckNode(checkWrapper, checkElement.classList.contains(CHECK), li, event.originalEvent);
@@ -12339,6 +12340,15 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12339
12340
  }
12340
12341
  selectNode(li, e, multiSelect) {
12341
12342
  if (isNullOrUndefined(li) || (!this.allowMultiSelection && this.isActive(li) && !isNullOrUndefined(e))) {
12343
+ if (this.checkOnClick) {
12344
+ const checkboxElement = select(' .' + CHECKBOXFRAME, li);
12345
+ if (!isNullOrUndefined(checkboxElement) && checkboxElement.classList.contains(CHECK)) {
12346
+ addClass([li], ACTIVE);
12347
+ }
12348
+ else {
12349
+ removeClass([li], ACTIVE);
12350
+ }
12351
+ }
12342
12352
  this.setFocusElement(li);
12343
12353
  return;
12344
12354
  }
@@ -12707,6 +12717,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12707
12717
  }
12708
12718
  }
12709
12719
  this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true);
12720
+ this.updateActiveClass(li, isCheck);
12710
12721
  if (this.autoCheck) {
12711
12722
  this.ensureChildCheckState(li);
12712
12723
  this.updateOldCheckedData([this.getNodeData(li)]);
@@ -12722,6 +12733,17 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12722
12733
  }
12723
12734
  this.nodeCheckedEvent(checkWrap, isCheck, e);
12724
12735
  }
12736
+ updateActiveClass(liElement, checkStatus) {
12737
+ if (this.showCheckBox && this.checkOnClick) {
12738
+ if (checkStatus === 'check' || checkStatus === false) {
12739
+ this.removeSelectAll();
12740
+ addClass([liElement], ACTIVE);
12741
+ }
12742
+ else if (checkStatus === 'uncheck' || checkStatus === 'indeterminate' || checkStatus === true) {
12743
+ removeClass([liElement], ACTIVE);
12744
+ }
12745
+ }
12746
+ }
12725
12747
  /**
12726
12748
  * Update checkedNodes when UI interaction happens before the child node renders in DOM
12727
12749
  *
@@ -15761,6 +15783,9 @@ __decorate$8([
15761
15783
  __decorate$8([
15762
15784
  Property(false)
15763
15785
  ], TreeView.prototype, "showCheckBox", void 0);
15786
+ __decorate$8([
15787
+ Property(false)
15788
+ ], TreeView.prototype, "checkOnClick", void 0);
15764
15789
  __decorate$8([
15765
15790
  Property(true)
15766
15791
  ], TreeView.prototype, "autoCheck", void 0);