@syncfusion/ej2-navigations 20.3.57 → 20.3.60

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.
@@ -11596,6 +11596,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11596
11596
  return (typeof mapper.child === 'string' || isNullOrUndefined(mapper.child)) ? mapper : mapper.child;
11597
11597
  };
11598
11598
  TreeView.prototype.getChildNodes = function (obj, parentId, isRoot) {
11599
+ var _this = this;
11599
11600
  if (isRoot === void 0) { isRoot = false; }
11600
11601
  var childNodes;
11601
11602
  if (isNullOrUndefined(obj)) {
@@ -11606,15 +11607,22 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11606
11607
  }
11607
11608
  else {
11608
11609
  if (typeof this.fields.child === 'string') {
11609
- for (var i = 0, objlen = obj.length; i < objlen; i++) {
11610
- var dataId = getValue(this.fields.id, obj[i]);
11611
- if (dataId && dataId.toString() === parentId) {
11612
- return getValue(this.fields.child, obj[i]);
11613
- }
11614
- else if (!isNullOrUndefined(getValue(this.fields.child, obj[i]))) {
11615
- childNodes = this.getChildNodes(getValue(this.fields.child, obj[i]), parentId);
11616
- if (childNodes !== undefined) {
11617
- break;
11610
+ var index = obj.findIndex(function (data) { return data[_this.fields.id] && data[_this.fields.id].toString() === parentId; });
11611
+ if (index !== -1) {
11612
+ return getValue(this.fields.child, obj[index]);
11613
+ }
11614
+ if (index === -1) {
11615
+ for (var i = 0, objlen = obj.length; i < objlen; i++) {
11616
+ var tempArray = getValue(this.fields.child, obj[i]);
11617
+ var childIndex = !isNullOrUndefined(tempArray) ? tempArray.findIndex(function (data) { return data[_this.fields.id] && data[_this.fields.id].toString() === parentId; }) : -1;
11618
+ if (childIndex !== -1) {
11619
+ return getValue(this.fields.child, tempArray[childIndex]);
11620
+ }
11621
+ else if (!isNullOrUndefined(tempArray)) {
11622
+ childNodes = this.getChildNodes(tempArray, parentId);
11623
+ if (childNodes !== undefined) {
11624
+ break;
11625
+ }
11618
11626
  }
11619
11627
  }
11620
11628
  }
@@ -13409,6 +13417,13 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13409
13417
  var li = ListBase.createListItemFromJson(this.createElement, sNodes, this.listBaseOption, level);
13410
13418
  var id = this.getId(dropLi);
13411
13419
  var refNode;
13420
+ var dropIcon1;
13421
+ if (!isNullOrUndefined(dropLi)) {
13422
+ dropIcon1 = select('div.' + ICON, dropLi);
13423
+ }
13424
+ if (this.dataType === 1 && dropIcon1 && dropIcon1.classList.contains(EXPANDABLE) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13425
+ this.preventExpand = true;
13426
+ }
13412
13427
  if (this.dataType !== 1) {
13413
13428
  this.addChildData(this.treeData, this.fields, id, nodes, index);
13414
13429
  this.isFirstRender = false;
@@ -13426,6 +13441,13 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13426
13441
  for (var i = 0; i < li.length; i++) {
13427
13442
  dropUl.insertBefore(li[i], refNode);
13428
13443
  }
13444
+ if (this.dataType === 1 && !isNullOrUndefined(dropLi) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13445
+ this.preventExpand = false;
13446
+ var dropIcon = select('div.' + ICON, dropLi);
13447
+ if (dropIcon && dropIcon.classList.contains(EXPANDABLE)) {
13448
+ this.expandAction(dropLi, dropIcon, null);
13449
+ }
13450
+ }
13429
13451
  }
13430
13452
  if (!refNode && ((this.sortOrder === 'Ascending') || (this.sortOrder === 'Descending'))) {
13431
13453
  var cNodes = dropUl.childNodes;
@@ -16630,8 +16652,10 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
16630
16652
  var navigators = this.createElement('div', { className: CLS_NAVIGATORS });
16631
16653
  var itemsContainer = this.element.querySelector("." + CLS_SLIDE_CONTAINER);
16632
16654
  itemsContainer.insertAdjacentElement('afterend', navigators);
16633
- this.renderNavigatorButton('Previous');
16634
- this.renderNavigatorButton('Next');
16655
+ if (!isNullOrUndefined(this.slideItems) && this.slideItems.length > 1) {
16656
+ this.renderNavigatorButton('Previous');
16657
+ this.renderNavigatorButton('Next');
16658
+ }
16635
16659
  this.renderTemplates();
16636
16660
  };
16637
16661
  Carousel.prototype.renderNavigatorButton = function (direction) {
@@ -16667,7 +16691,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
16667
16691
  EventHandler.add(buttonContainer, 'click', this.navigatorClickHandler, this);
16668
16692
  };
16669
16693
  Carousel.prototype.renderPlayButton = function () {
16670
- if (this.buttonsVisibility === 'Hidden' || !this.showPlayButton) {
16694
+ if (isNullOrUndefined(this.slideItems) || this.buttonsVisibility === 'Hidden' || !this.showPlayButton || this.slideItems.length <= 1) {
16671
16695
  return;
16672
16696
  }
16673
16697
  var playPauseWrap = this.createElement('div', {
@@ -16768,6 +16792,9 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
16768
16792
  }
16769
16793
  };
16770
16794
  Carousel.prototype.autoSlide = function () {
16795
+ if (isNullOrUndefined(this.slideItems) || this.slideItems.length <= 1) {
16796
+ return;
16797
+ }
16771
16798
  this.resetSlideInterval();
16772
16799
  this.applySlideInterval();
16773
16800
  };