@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.
@@ -11279,15 +11279,22 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11279
11279
  }
11280
11280
  else {
11281
11281
  if (typeof this.fields.child === 'string') {
11282
- for (let i = 0, objlen = obj.length; i < objlen; i++) {
11283
- let dataId = getValue(this.fields.id, obj[i]);
11284
- if (dataId && dataId.toString() === parentId) {
11285
- return getValue(this.fields.child, obj[i]);
11286
- }
11287
- else if (!isNullOrUndefined(getValue(this.fields.child, obj[i]))) {
11288
- childNodes = this.getChildNodes(getValue(this.fields.child, obj[i]), parentId);
11289
- if (childNodes !== undefined) {
11290
- break;
11282
+ let index = obj.findIndex((data) => data[this.fields.id] && data[this.fields.id].toString() === parentId);
11283
+ if (index !== -1) {
11284
+ return getValue(this.fields.child, obj[index]);
11285
+ }
11286
+ if (index === -1) {
11287
+ for (let i = 0, objlen = obj.length; i < objlen; i++) {
11288
+ let tempArray = getValue(this.fields.child, obj[i]);
11289
+ let childIndex = !isNullOrUndefined(tempArray) ? tempArray.findIndex((data) => data[this.fields.id] && data[this.fields.id].toString() === parentId) : -1;
11290
+ if (childIndex !== -1) {
11291
+ return getValue(this.fields.child, tempArray[childIndex]);
11292
+ }
11293
+ else if (!isNullOrUndefined(tempArray)) {
11294
+ childNodes = this.getChildNodes(tempArray, parentId);
11295
+ if (childNodes !== undefined) {
11296
+ break;
11297
+ }
11291
11298
  }
11292
11299
  }
11293
11300
  }
@@ -13071,6 +13078,13 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13071
13078
  let li = ListBase.createListItemFromJson(this.createElement, sNodes, this.listBaseOption, level);
13072
13079
  let id = this.getId(dropLi);
13073
13080
  let refNode;
13081
+ let dropIcon1;
13082
+ if (!isNullOrUndefined(dropLi)) {
13083
+ dropIcon1 = select('div.' + ICON, dropLi);
13084
+ }
13085
+ if (this.dataType === 1 && dropIcon1 && dropIcon1.classList.contains(EXPANDABLE) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13086
+ this.preventExpand = true;
13087
+ }
13074
13088
  if (this.dataType !== 1) {
13075
13089
  this.addChildData(this.treeData, this.fields, id, nodes, index);
13076
13090
  this.isFirstRender = false;
@@ -13088,6 +13102,13 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13088
13102
  for (let i = 0; i < li.length; i++) {
13089
13103
  dropUl.insertBefore(li[i], refNode);
13090
13104
  }
13105
+ if (this.dataType === 1 && !isNullOrUndefined(dropLi) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13106
+ this.preventExpand = false;
13107
+ let dropIcon = select('div.' + ICON, dropLi);
13108
+ if (dropIcon && dropIcon.classList.contains(EXPANDABLE)) {
13109
+ this.expandAction(dropLi, dropIcon, null);
13110
+ }
13111
+ }
13091
13112
  }
13092
13113
  if (!refNode && ((this.sortOrder === 'Ascending') || (this.sortOrder === 'Descending'))) {
13093
13114
  let cNodes = dropUl.childNodes;
@@ -16219,8 +16240,10 @@ let Carousel = class Carousel extends Component {
16219
16240
  const navigators = this.createElement('div', { className: CLS_NAVIGATORS });
16220
16241
  const itemsContainer = this.element.querySelector(`.${CLS_SLIDE_CONTAINER}`);
16221
16242
  itemsContainer.insertAdjacentElement('afterend', navigators);
16222
- this.renderNavigatorButton('Previous');
16223
- this.renderNavigatorButton('Next');
16243
+ if (!isNullOrUndefined(this.slideItems) && this.slideItems.length > 1) {
16244
+ this.renderNavigatorButton('Previous');
16245
+ this.renderNavigatorButton('Next');
16246
+ }
16224
16247
  this.renderTemplates();
16225
16248
  }
16226
16249
  renderNavigatorButton(direction) {
@@ -16256,7 +16279,7 @@ let Carousel = class Carousel extends Component {
16256
16279
  EventHandler.add(buttonContainer, 'click', this.navigatorClickHandler, this);
16257
16280
  }
16258
16281
  renderPlayButton() {
16259
- if (this.buttonsVisibility === 'Hidden' || !this.showPlayButton) {
16282
+ if (isNullOrUndefined(this.slideItems) || this.buttonsVisibility === 'Hidden' || !this.showPlayButton || this.slideItems.length <= 1) {
16260
16283
  return;
16261
16284
  }
16262
16285
  const playPauseWrap = this.createElement('div', {
@@ -16356,6 +16379,9 @@ let Carousel = class Carousel extends Component {
16356
16379
  }
16357
16380
  }
16358
16381
  autoSlide() {
16382
+ if (isNullOrUndefined(this.slideItems) || this.slideItems.length <= 1) {
16383
+ return;
16384
+ }
16359
16385
  this.resetSlideInterval();
16360
16386
  this.applySlideInterval();
16361
16387
  }