@syncfusion/ej2-navigations 20.4.44 → 20.4.49

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/ej2-navigations.min.js +2 -2
  3. package/dist/ej2-navigations.umd.min.js +2 -2
  4. package/dist/ej2-navigations.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-navigations.es2015.js +106 -31
  6. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  7. package/dist/es6/ej2-navigations.es5.js +116 -40
  8. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  9. package/dist/global/ej2-navigations.min.js +2 -2
  10. package/dist/global/ej2-navigations.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +11 -11
  13. package/src/carousel/carousel.js +2 -4
  14. package/src/common/index.d.ts +1 -1
  15. package/src/common/index.js +1 -1
  16. package/src/common/menu-base.js +4 -0
  17. package/src/menu/menu.js +1 -0
  18. package/src/sidebar/sidebar.js +1 -1
  19. package/src/tab/tab.js +8 -4
  20. package/src/toolbar/toolbar.js +16 -4
  21. package/src/treeview/treeview.d.ts +14 -0
  22. package/src/treeview/treeview.js +83 -26
  23. package/styles/accordion/_theme.scss +4 -4
  24. package/styles/accordion/bootstrap-dark.css +3 -3
  25. package/styles/accordion/bootstrap.css +3 -3
  26. package/styles/accordion/bootstrap4.css +3 -3
  27. package/styles/accordion/bootstrap5-dark.css +3 -3
  28. package/styles/accordion/bootstrap5.css +3 -3
  29. package/styles/accordion/fabric-dark.css +3 -3
  30. package/styles/accordion/fabric.css +3 -3
  31. package/styles/accordion/fluent-dark.css +3 -3
  32. package/styles/accordion/fluent.css +3 -3
  33. package/styles/accordion/highcontrast-light.css +3 -3
  34. package/styles/accordion/highcontrast.css +3 -3
  35. package/styles/accordion/material-dark.css +3 -3
  36. package/styles/accordion/material.css +3 -3
  37. package/styles/accordion/tailwind-dark.css +3 -3
  38. package/styles/accordion/tailwind.css +3 -3
  39. package/styles/bootstrap-dark.css +4 -3
  40. package/styles/bootstrap.css +4 -3
  41. package/styles/bootstrap4.css +5 -4
  42. package/styles/bootstrap5-dark.css +5 -44
  43. package/styles/bootstrap5.css +5 -44
  44. package/styles/context-menu/_layout-mixin.scss +3 -1
  45. package/styles/context-menu/_layout.scss +3 -1
  46. package/styles/context-menu/_theme-mixin.scss +16 -12
  47. package/styles/context-menu/bootstrap5-dark.css +0 -24
  48. package/styles/context-menu/bootstrap5.css +0 -24
  49. package/styles/context-menu/fluent-dark.css +0 -14
  50. package/styles/context-menu/fluent.css +0 -14
  51. package/styles/fabric-dark.css +8 -7
  52. package/styles/fabric.css +8 -7
  53. package/styles/fluent-dark.css +5 -19
  54. package/styles/fluent.css +5 -19
  55. package/styles/highcontrast-light.css +4 -3
  56. package/styles/highcontrast.css +4 -3
  57. package/styles/material-dark.css +4 -3
  58. package/styles/material.css +4 -3
  59. package/styles/menu/_layout.scss +1 -0
  60. package/styles/menu/_theme.scss +1 -1
  61. package/styles/menu/bootstrap-dark.css +1 -0
  62. package/styles/menu/bootstrap.css +1 -0
  63. package/styles/menu/bootstrap4.css +1 -0
  64. package/styles/menu/bootstrap5-dark.css +1 -16
  65. package/styles/menu/bootstrap5.css +1 -16
  66. package/styles/menu/fabric-dark.css +5 -4
  67. package/styles/menu/fabric.css +5 -4
  68. package/styles/menu/fluent-dark.css +2 -2
  69. package/styles/menu/fluent.css +2 -2
  70. package/styles/menu/highcontrast-light.css +1 -0
  71. package/styles/menu/highcontrast.css +1 -0
  72. package/styles/menu/icons/_fabric-dark.scss +4 -4
  73. package/styles/menu/icons/_fabric.scss +4 -4
  74. package/styles/menu/material-dark.css +1 -0
  75. package/styles/menu/material.css +1 -0
  76. package/styles/menu/tailwind-dark.css +1 -0
  77. package/styles/menu/tailwind.css +1 -0
  78. package/styles/tailwind-dark.css +4 -3
  79. package/styles/tailwind.css +4 -3
  80. package/styles/treeview/_bootstrap4-definition.scss +1 -1
  81. package/styles/treeview/_bootstrap5-definition.scss +1 -1
  82. package/styles/treeview/bootstrap4.css +1 -1
  83. package/styles/treeview/bootstrap5-dark.css +1 -1
  84. package/styles/treeview/bootstrap5.css +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.4.44
3
+ * version : 20.4.49
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-navigations@*",
3
- "_id": "@syncfusion/ej2-navigations@20.4.43",
3
+ "_id": "@syncfusion/ej2-navigations@20.4.48",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-i+34uRyNysO690StEyuw9/rOtO+ZTePBjmZkoChF7+FhbQx4cE3c/0EPfBsVioKxkwS9iFd1hnJSLL3NpVCiZQ==",
5
+ "_integrity": "sha512-R5EqcU5jCkiqVZkMW3dxvw8RCaORaZB6tEFqpbD8WzFJYN9F5aY3guccFBLQJ8endEyUQfRz07PiIqEHyQU3ug==",
6
6
  "_location": "/@syncfusion/ej2-navigations",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -38,8 +38,8 @@
38
38
  "/@syncfusion/ej2-spreadsheet",
39
39
  "/@syncfusion/ej2-vue-navigations"
40
40
  ],
41
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-20.4.43.tgz",
42
- "_shasum": "a06a120de2a3bb809ab71836f16e3377c797d5ae",
41
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-20.4.48.tgz",
42
+ "_shasum": "1526c3fee161b4e9a293794a53f36a4b0431cfeb",
43
43
  "_spec": "@syncfusion/ej2-navigations@*",
44
44
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
45
45
  "author": {
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "bundleDependencies": false,
52
52
  "dependencies": {
53
- "@syncfusion/ej2-base": "~20.4.44",
54
- "@syncfusion/ej2-buttons": "~20.4.44",
55
- "@syncfusion/ej2-data": "~20.4.44",
56
- "@syncfusion/ej2-inputs": "~20.4.42",
57
- "@syncfusion/ej2-lists": "~20.4.42",
58
- "@syncfusion/ej2-popups": "~20.4.44"
53
+ "@syncfusion/ej2-base": "~20.4.48",
54
+ "@syncfusion/ej2-buttons": "~20.4.49",
55
+ "@syncfusion/ej2-data": "~20.4.48",
56
+ "@syncfusion/ej2-inputs": "~20.4.48",
57
+ "@syncfusion/ej2-lists": "~20.4.48",
58
+ "@syncfusion/ej2-popups": "~20.4.49"
59
59
  },
60
60
  "deprecated": false,
61
61
  "description": "A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another",
@@ -160,6 +160,6 @@
160
160
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
161
161
  },
162
162
  "typings": "index.d.ts",
163
- "version": "20.4.44",
163
+ "version": "20.4.49",
164
164
  "sideEffects": false
165
165
  }
@@ -616,17 +616,15 @@ var Carousel = /** @class */ (function (_super) {
616
616
  container.style.transform = "translateX(" + -(slideWidth) * (currentIndex) + "px)";
617
617
  }
618
618
  }
619
- var slideHeight;
620
619
  if (_this.animationEffect === 'Slide') {
621
620
  if (direction === 'Previous') {
622
621
  addClass([args.nextSlide], CLS_PREV_SLIDE);
623
- slideHeight = args.nextSlide.offsetHeight;
622
+ args.nextSlide.setAttribute('data-slide-height', args.nextSlide.offsetHeight.toString());
624
623
  addClass([args.currentSlide, args.nextSlide], CLS_TRANSITION_END);
625
624
  }
626
625
  else {
627
626
  addClass([args.nextSlide], CLS_NEXT_SLIDE);
628
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
629
- slideHeight = args.nextSlide.offsetHeight;
627
+ args.nextSlide.setAttribute('data-slide-height', args.nextSlide.offsetHeight.toString());
630
628
  addClass([args.currentSlide, args.nextSlide], CLS_TRANSITION_START);
631
629
  }
632
630
  }
@@ -5,5 +5,5 @@ export * from './h-scroll';
5
5
  export * from './v-scroll';
6
6
  export * from './menu-scroll';
7
7
  export { MenuEventArgs, OpenCloseMenuEventArgs, BeforeOpenCloseMenuEventArgs, MenuAnimationSettings, MenuEffect } from './menu-base';
8
- export { MenuItem } from './menu-base';
8
+ export { MenuItem, FieldSettings } from './menu-base';
9
9
  export { MenuItemModel, FieldSettingsModel, MenuAnimationSettingsModel } from './menu-base-model';
@@ -5,4 +5,4 @@ export * from './h-scroll';
5
5
  export * from './v-scroll';
6
6
  export * from './menu-scroll';
7
7
  export { MenuAnimationSettings } from './menu-base';
8
- export { MenuItem } from './menu-base';
8
+ export { MenuItem, FieldSettings } from './menu-base';
@@ -1653,6 +1653,10 @@ var MenuBase = /** @class */ (function (_super) {
1653
1653
  var idx = void 0;
1654
1654
  var navIdx = void 0;
1655
1655
  var item = void 0;
1656
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1657
+ if (this_1.isReact && this_1.template) {
1658
+ this_1.clearTemplate(['template']);
1659
+ }
1656
1660
  if (!Object.keys(oldProp.items).length) {
1657
1661
  this_1.updateItem(this_1.element, this_1.items);
1658
1662
  if (this_1.enableScrolling && this_1.element.parentElement.classList.contains('e-custom-scroll')) {
package/src/menu/menu.js CHANGED
@@ -79,6 +79,7 @@ var Menu = /** @class */ (function (_super) {
79
79
  catch (e) {
80
80
  /* action on catch */
81
81
  }
82
+ this.updateMenuItems(this.items);
82
83
  }
83
84
  else {
84
85
  this.updateMenuItems(this.items);
@@ -198,7 +198,7 @@ var Sidebar = /** @class */ (function (_super) {
198
198
  };
199
199
  Sidebar.prototype.destroyBackDrop = function () {
200
200
  var sibling = document.querySelector('.e-main-content') || this.targetEle;
201
- if (this.target && this.showBackdrop && sibling) {
201
+ if (this.target && this.showBackdrop && sibling && !isNullOrUndefined(this.defaultBackdropDiv)) {
202
202
  removeClass([this.defaultBackdropDiv], DEFAULTBACKDROP);
203
203
  }
204
204
  else if (this.showBackdrop && this.modal) {
package/src/tab/tab.js CHANGED
@@ -427,6 +427,14 @@ var Tab = /** @class */ (function (_super) {
427
427
  this.tbObj.createElement = this.createElement;
428
428
  this.tbObj.appendTo(this.hdrEle);
429
429
  attributes(this.hdrEle, { role: 'tablist' });
430
+ if (!isNOU(this.element.getAttribute('aria-label'))) {
431
+ this.hdrEle.setAttribute('aria-label', this.element.getAttribute('aria-label'));
432
+ this.element.removeAttribute('aria-label');
433
+ }
434
+ else if (!isNOU(this.element.getAttribute('aria-labelledby'))) {
435
+ this.hdrEle.setAttribute('aria-labelledby', this.element.getAttribute('aria-labelledby'));
436
+ this.element.removeAttribute('aria-labelledby');
437
+ }
430
438
  this.setCloseButton(this.showCloseButton);
431
439
  var toolbarHeader = this.tbObj.element.querySelector('.' + CLS_TB_ITEMS);
432
440
  if (!isNOU(toolbarHeader)) {
@@ -1100,10 +1108,6 @@ var Tab = /** @class */ (function (_super) {
1100
1108
  return;
1101
1109
  }
1102
1110
  if (!this.isTemplate) {
1103
- var prev = this.tbItem[this.prevIndex];
1104
- if (!isNOU(prev)) {
1105
- prev.firstElementChild.removeAttribute('aria-controls');
1106
- }
1107
1111
  attributes(trg.firstElementChild, { 'aria-controls': CLS_CONTENT + this.tabId + '_' + value });
1108
1112
  }
1109
1113
  var id = trg.id;
@@ -438,8 +438,11 @@ var Toolbar = /** @class */ (function (_super) {
438
438
  if (popObj && closest(trgt, '.e-popup')) {
439
439
  var popEle = popObj.element;
440
440
  var popFrstEle = popEle.firstElementChild;
441
- if ((value === 'previous' && popFrstEle === clst) || (value === 'next' && popEle.lastElementChild === clst)) {
442
- return;
441
+ if ((value === 'previous' && popFrstEle === clst)) {
442
+ popEle.lastElementChild.firstChild.focus();
443
+ }
444
+ else if (value === 'next' && popEle.lastElementChild === clst) {
445
+ popFrstEle.firstChild.focus();
443
446
  }
444
447
  else {
445
448
  this.eleFocus(clst, value);
@@ -533,7 +536,7 @@ var Toolbar = /** @class */ (function (_super) {
533
536
  }
534
537
  };
535
538
  Toolbar.prototype.eleContains = function (el) {
536
- return el.classList.contains(CLS_SEPARATOR) || el.classList.contains(CLS_DISABLE) || el.getAttribute('disabled') || el.classList.contains(CLS_HIDDEN) || !isVisible(el);
539
+ return el.classList.contains(CLS_SEPARATOR) || el.classList.contains(CLS_DISABLE) || el.getAttribute('disabled') || el.classList.contains(CLS_HIDDEN) || !isVisible(el) || !el.classList.contains(CLS_ITEM);
537
540
  };
538
541
  Toolbar.prototype.eleFocus = function (closest, pos) {
539
542
  var sib = Object(closest)[pos + 'ElementSibling'];
@@ -572,6 +575,15 @@ var Toolbar = /** @class */ (function (_super) {
572
575
  }
573
576
  }
574
577
  }
578
+ else if (!isNOU(closest)) {
579
+ var tbrItems = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')' + ':not(.' + CLS_DISABLE + ')' + ':not(.' + CLS_HIDDEN + ')');
580
+ if (pos === 'next' && tbrItems) {
581
+ this.elementFocus(tbrItems[0]);
582
+ }
583
+ else if (pos === 'previous' && tbrItems) {
584
+ this.elementFocus(tbrItems[tbrItems.length - 1]);
585
+ }
586
+ }
575
587
  };
576
588
  Toolbar.prototype.clickHandler = function (e) {
577
589
  var _this = this;
@@ -2113,7 +2125,7 @@ var Toolbar = /** @class */ (function (_super) {
2113
2125
  this.destroyMode();
2114
2126
  }
2115
2127
  var itemCol = [].slice.call(selectAll('.' + CLS_ITEMS + ' .' + CLS_ITEM, tEle));
2116
- if (this.isReact) {
2128
+ if (this.isReact && this.items[parseInt(index.toString(), 10)].template) {
2117
2129
  this.clearTemplate();
2118
2130
  }
2119
2131
  detach(itemCol[parseInt(index.toString(), 10)]);
@@ -275,6 +275,18 @@ export interface DataSourceChangedEventArgs {
275
275
  data: {
276
276
  [key: string]: Object;
277
277
  }[];
278
+ /**
279
+ * Return the action which triggers the event
280
+ *
281
+ */
282
+ action: string;
283
+ /**
284
+ * Return the new node data of updated data source
285
+ *
286
+ */
287
+ nodeData: {
288
+ [key: string]: Object;
289
+ }[];
278
290
  }
279
291
  /**
280
292
  * Interface that holds the node details.
@@ -523,6 +535,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
523
535
  private isFirstRender;
524
536
  private isNodeDropped;
525
537
  private isInteracted;
538
+ private isRightClick;
526
539
  /**
527
540
  * Indicates whether the TreeView allows drag and drop of nodes. To drag and drop a node in
528
541
  * desktop, hold the mouse on the node, drag it to the target node and drop the node by releasing
@@ -1212,6 +1225,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1212
1225
  private addSuccess;
1213
1226
  private dmFailure;
1214
1227
  private updatePreviousText;
1228
+ private getHierarchicalParentId;
1215
1229
  /**
1216
1230
  * Called internally if any of the property value changed.
1217
1231
  * @param {TreeView} newProp
@@ -217,6 +217,7 @@ var TreeView = /** @class */ (function (_super) {
217
217
  // Specifies whether the node is dropped or not
218
218
  _this.isNodeDropped = false;
219
219
  _this.isInteracted = false;
220
+ _this.isRightClick = false;
220
221
  _this.mouseDownStatus = false;
221
222
  return _this;
222
223
  }
@@ -1526,6 +1527,9 @@ var TreeView = /** @class */ (function (_super) {
1526
1527
  }
1527
1528
  }
1528
1529
  }
1530
+ if (event.originalEvent.which === 3) {
1531
+ this.isRightClick = true;
1532
+ }
1529
1533
  this.triggerClickEvent(event.originalEvent, li);
1530
1534
  }
1531
1535
  };
@@ -1964,7 +1968,7 @@ var TreeView = /** @class */ (function (_super) {
1964
1968
  if (this.isLoaded) {
1965
1969
  eventArgs = this.getSelectEvent(li, 'select', e);
1966
1970
  this.trigger('nodeSelecting', eventArgs, function (observedArgs) {
1967
- if (!observedArgs.cancel && !observedArgs.node.classList.contains(PREVENTSELECT)) {
1971
+ if ((!observedArgs.cancel) && !observedArgs.node.classList.contains(PREVENTSELECT)) {
1968
1972
  _this.nodeSelectAction(li, e, observedArgs, multiSelect);
1969
1973
  }
1970
1974
  });
@@ -2004,6 +2008,7 @@ var TreeView = /** @class */ (function (_super) {
2004
2008
  eventArgs.nodeData = this.getNodeData(li);
2005
2009
  this.trigger('nodeSelected', eventArgs);
2006
2010
  }
2011
+ this.isRightClick = false;
2007
2012
  };
2008
2013
  TreeView.prototype.unselectNode = function (li, e) {
2009
2014
  var _this = this;
@@ -2831,7 +2836,7 @@ var TreeView = /** @class */ (function (_super) {
2831
2836
  newText = observedArgs.cancel ? observedArgs.oldText : observedArgs.newText;
2832
2837
  _this.updateText(liEle, txtEle, newText, isInput);
2833
2838
  if (observedArgs.oldText !== newText) {
2834
- _this.triggerEvent();
2839
+ _this.triggerEvent('nodeEdited', [_this.getNode(liEle)]);
2835
2840
  }
2836
2841
  });
2837
2842
  };
@@ -3146,10 +3151,12 @@ var TreeView = /** @class */ (function (_super) {
3146
3151
  var level;
3147
3152
  var drop = false;
3148
3153
  var dragInstance;
3154
+ var nodeData = [];
3155
+ var liArray = [];
3149
3156
  dragInstance = e.dragData.draggable;
3150
- for (var i = 0; i < dragInstance.ej2_instances.length; i++) {
3151
- if (dragInstance.ej2_instances[i] instanceof TreeView_1) {
3152
- dragObj = dragInstance.ej2_instances[i];
3157
+ for (var i_1 = 0; i_1 < dragInstance.ej2_instances.length; i_1++) {
3158
+ if (dragInstance.ej2_instances[i_1] instanceof TreeView_1) {
3159
+ dragObj = dragInstance.ej2_instances[i_1];
3153
3160
  break;
3154
3161
  }
3155
3162
  }
@@ -3157,6 +3164,7 @@ var TreeView = /** @class */ (function (_super) {
3157
3164
  var dragTarget = dragObj.dragTarget;
3158
3165
  var dragLi = (closest(dragTarget, '.' + LISTITEM));
3159
3166
  var dropLi = (closest(dropTarget, '.' + LISTITEM));
3167
+ liArray.push(dragLi);
3160
3168
  if (dropLi == null && dropTarget.classList.contains(ROOT)) {
3161
3169
  dropLi = dropTarget.firstElementChild;
3162
3170
  }
@@ -3170,20 +3178,21 @@ var TreeView = /** @class */ (function (_super) {
3170
3178
  }
3171
3179
  if (dragObj.allowMultiSelection && dragLi.classList.contains(ACTIVE)) {
3172
3180
  var sNodes = selectAll('.' + ACTIVE, dragObj.element);
3181
+ liArray = sNodes;
3173
3182
  if (e.target.offsetHeight <= 33 && offsetY > e.target.offsetHeight - 10 && offsetY > 6) {
3174
- for (var i = sNodes.length - 1; i >= 0; i--) {
3175
- if (dropLi.isSameNode(sNodes[i]) || this.isDescendant(sNodes[i], dropLi)) {
3183
+ for (var i_2 = sNodes.length - 1; i_2 >= 0; i_2--) {
3184
+ if (dropLi.isSameNode(sNodes[i_2]) || this.isDescendant(sNodes[i_2], dropLi)) {
3176
3185
  continue;
3177
3186
  }
3178
- this.appendNode(dropTarget, sNodes[i], dropLi, e, dragObj, offsetY);
3187
+ this.appendNode(dropTarget, sNodes[i_2], dropLi, e, dragObj, offsetY);
3179
3188
  }
3180
3189
  }
3181
3190
  else {
3182
- for (var i = 0; i < sNodes.length; i++) {
3183
- if (dropLi.isSameNode(sNodes[i]) || this.isDescendant(sNodes[i], dropLi)) {
3191
+ for (var i_3 = 0; i_3 < sNodes.length; i_3++) {
3192
+ if (dropLi.isSameNode(sNodes[i_3]) || this.isDescendant(sNodes[i_3], dropLi)) {
3184
3193
  continue;
3185
3194
  }
3186
- this.appendNode(dropTarget, sNodes[i], dropLi, e, dragObj, offsetY);
3195
+ this.appendNode(dropTarget, sNodes[i_3], dropLi, e, dragObj, offsetY);
3187
3196
  }
3188
3197
  }
3189
3198
  }
@@ -3196,13 +3205,16 @@ var TreeView = /** @class */ (function (_super) {
3196
3205
  if (this.fields.dataSource instanceof DataManager === false) {
3197
3206
  this.preventExpand = false;
3198
3207
  }
3208
+ for (var i = 0; i < liArray.length; i++) {
3209
+ nodeData.push(this.getNode(liArray[i]));
3210
+ }
3199
3211
  this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.dragData.draggedElement, null, level, drop));
3200
3212
  if (dragObj.element.id !== this.element.id) {
3201
- dragObj.triggerEvent();
3213
+ dragObj.triggerEvent('nodeDropped', nodeData);
3202
3214
  this.isNodeDropped = true;
3203
3215
  this.fields.dataSource = this.treeData;
3204
3216
  }
3205
- this.triggerEvent();
3217
+ this.triggerEvent('nodeDropped', nodeData);
3206
3218
  };
3207
3219
  TreeView.prototype.appendNode = function (dropTarget, dragLi, dropLi, e, dragObj, offsetY) {
3208
3220
  var checkWrapper = closest(dropTarget, '.' + CHECKBOXWRAP);
@@ -4025,9 +4037,16 @@ var TreeView = /** @class */ (function (_super) {
4025
4037
  }
4026
4038
  return removedData;
4027
4039
  };
4028
- TreeView.prototype.triggerEvent = function () {
4040
+ TreeView.prototype.triggerEvent = function (action, node) {
4029
4041
  this.renderReactTemplates();
4030
- var eventArgs = { data: this.treeData };
4042
+ if (action === 'addNodes') {
4043
+ var nodeData = [];
4044
+ for (var i = 0; i < node.length; i++) {
4045
+ nodeData.push(this.getNode(this.getElement(isNOU(node[i][this.fields.id]) ? getValue(this.fields.id, node[i]).toString() : null)));
4046
+ }
4047
+ node = nodeData;
4048
+ }
4049
+ var eventArgs = { data: this.treeData, action: action, nodeData: node };
4031
4050
  this.trigger('dataSourceChanged', eventArgs);
4032
4051
  };
4033
4052
  TreeView.prototype.wireInputEvents = function (inpEle) {
@@ -4405,8 +4424,10 @@ var TreeView = /** @class */ (function (_super) {
4405
4424
  }
4406
4425
  };
4407
4426
  TreeView.prototype.deleteSuccess = function (nodes) {
4427
+ var nodeData = [];
4408
4428
  for (var i = 0, len = nodes.length; i < len; i++) {
4409
4429
  var liEle = this.getElement(nodes[i]);
4430
+ nodeData.push(this.getNode(liEle));
4410
4431
  if (isNOU(liEle)) {
4411
4432
  continue;
4412
4433
  }
@@ -4416,7 +4437,7 @@ var TreeView = /** @class */ (function (_super) {
4416
4437
  if (this.dataType === 1) {
4417
4438
  this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);
4418
4439
  }
4419
- this.triggerEvent();
4440
+ this.triggerEvent('removeNode', nodeData);
4420
4441
  };
4421
4442
  TreeView.prototype.editSucess = function (target, newText, prevent) {
4422
4443
  var liEle = this.getElement(target);
@@ -4432,12 +4453,12 @@ var TreeView = /** @class */ (function (_super) {
4432
4453
  proxy.renderChildNodes(dropLi, null, function () {
4433
4454
  dropUl = dropLi.querySelector('.' + PARENTITEM);
4434
4455
  proxy.addGivenNodes(nodes, dropLi, index, true, dropUl);
4435
- proxy.triggerEvent();
4456
+ proxy.triggerEvent('addNodes', nodes);
4436
4457
  });
4437
4458
  }
4438
4459
  else {
4439
4460
  this.addGivenNodes(nodes, dropLi, index, true);
4440
- this.triggerEvent();
4461
+ this.triggerEvent('addNodes', nodes);
4441
4462
  }
4442
4463
  };
4443
4464
  TreeView.prototype.dmFailure = function (e, target, prevent) {
@@ -4451,6 +4472,27 @@ var TreeView = /** @class */ (function (_super) {
4451
4472
  var txtEle = select('.' + LISTTEXT, liEle);
4452
4473
  this.updateText(liEle, txtEle, this.oldText, prevent);
4453
4474
  };
4475
+ TreeView.prototype.getHierarchicalParentId = function (node, data, parentsID) {
4476
+ var _this = this;
4477
+ var index = data.findIndex(function (data) { return data[_this.fields.id] && data[_this.fields.id].toString() === node; });
4478
+ if (index == -1) {
4479
+ for (var i = 0; i < data.length; i++) {
4480
+ var childItems = getValue(this.fields.child.toString(), data[i]);
4481
+ if (!isNOU(childItems)) {
4482
+ index = childItems.findIndex(function (data) { return data[_this.fields.id] && data[_this.fields.id].toString() === node; });
4483
+ if (index == -1) {
4484
+ this.getHierarchicalParentId(node, childItems, parentsID);
4485
+ }
4486
+ else {
4487
+ parentsID.push(data[i][this.fields.id].toString());
4488
+ this.getHierarchicalParentId(data[i][this.fields.id].toString(), this.treeData, parentsID);
4489
+ break;
4490
+ }
4491
+ }
4492
+ }
4493
+ }
4494
+ return parentsID;
4495
+ };
4454
4496
  /**
4455
4497
  * Called internally if any of the property value changed.
4456
4498
  * @param {TreeView} newProp
@@ -4648,7 +4690,7 @@ var TreeView = /** @class */ (function (_super) {
4648
4690
  }
4649
4691
  if ((this.fields.dataSource instanceof DataManager === false)) {
4650
4692
  this.preventExpand = false;
4651
- this.triggerEvent();
4693
+ this.triggerEvent('addNodes', nodes);
4652
4694
  }
4653
4695
  };
4654
4696
  /**
@@ -4720,13 +4762,26 @@ var TreeView = /** @class */ (function (_super) {
4720
4762
  * @param {string | Element} node - Specifies ID of TreeView node/TreeView nodes.
4721
4763
  */
4722
4764
  TreeView.prototype.ensureVisible = function (node) {
4765
+ var parentsId = [];
4766
+ if (this.dataType == 1) {
4767
+ var nodeData = this.getTreeData(node);
4768
+ while (nodeData.length != 0 && !isNOU(nodeData[0][this.fields.parentID])) {
4769
+ parentsId.push(nodeData[0][this.fields.parentID].toString());
4770
+ nodeData = this.getTreeData(nodeData[0][this.fields.parentID].toString());
4771
+ }
4772
+ }
4773
+ else if (this.dataType == 2) {
4774
+ parentsId = this.getHierarchicalParentId(node, this.treeData, parentsId).reverse();
4775
+ }
4776
+ this.expandAll(parentsId);
4723
4777
  var liEle = this.getElement(node);
4724
- if (isNOU(liEle)) {
4725
- return;
4778
+ if (!isNOU(liEle)) {
4779
+ if (typeof node == 'object') {
4780
+ var parents = this.parents(liEle, '.' + LISTITEM);
4781
+ this.expandAll(parents);
4782
+ }
4783
+ setTimeout(function () { liEle.scrollIntoView({ behavior: "smooth" }); }, 450);
4726
4784
  }
4727
- var parents = this.parents(liEle, '.' + LISTITEM);
4728
- this.expandAll(parents);
4729
- setTimeout(function () { liEle.scrollIntoView(true); }, 450);
4730
4785
  };
4731
4786
  /**
4732
4787
  * Expands all the collapsed TreeView nodes. You can expand the specific nodes by passing the array of collapsed nodes
@@ -4800,11 +4855,13 @@ var TreeView = /** @class */ (function (_super) {
4800
4855
  */
4801
4856
  TreeView.prototype.moveNodes = function (sourceNodes, target, index, preventTargetExpand) {
4802
4857
  var dropLi = this.getElement(target);
4858
+ var nodeData = [];
4803
4859
  if (isNOU(dropLi)) {
4804
4860
  return;
4805
4861
  }
4806
4862
  for (var i = 0; i < sourceNodes.length; i++) {
4807
4863
  var dragLi = this.getElement(sourceNodes[i]);
4864
+ nodeData.push(this.getNode(dragLi));
4808
4865
  if (isNOU(dragLi) || dropLi.isSameNode(dragLi) || this.isDescendant(dragLi, dropLi)) {
4809
4866
  continue;
4810
4867
  }
@@ -4814,7 +4871,7 @@ var TreeView = /** @class */ (function (_super) {
4814
4871
  if (this.fields.dataSource instanceof DataManager === false) {
4815
4872
  this.preventExpand = false;
4816
4873
  }
4817
- this.triggerEvent();
4874
+ this.triggerEvent('moveNodes', nodeData);
4818
4875
  };
4819
4876
  /**
4820
4877
  * Refreshes a particular node of the TreeView.
@@ -4918,7 +4975,7 @@ var TreeView = /** @class */ (function (_super) {
4918
4975
  addClass([liEle], ACTIVE);
4919
4976
  }
4920
4977
  this.isRefreshed = false;
4921
- this.triggerEvent();
4978
+ this.triggerEvent('refreshNode', [this.getNode(liEle)]);
4922
4979
  };
4923
4980
  /**
4924
4981
  * Removes the collection of TreeView nodes by passing the array of node details as argument to this method.
@@ -8,16 +8,16 @@
8
8
  border: $acrdn-border-size $acrdn-border-type $acrdn-default-border;
9
9
  border-radius: $acrdn-border-radius;
10
10
 
11
- .e-active {
12
- background: $acrdn-active-bg-color;
13
- }
14
-
15
11
  .e-acrdn-item {
16
12
  border-color: $acrdn-item-border-color;
17
13
  border-style: $acrdn-item-border-nav-type;
18
14
  border-width: $acrdn-item-border-size;
19
15
  border-radius: $acrdn-item-border-radius;
20
16
 
17
+ &.e-active {
18
+ background: $acrdn-active-bg-color;
19
+ }
20
+
21
21
  &.e-select:last-child {
22
22
  border-bottom: $acrdn-item-select-last-child-border-bottom;
23
23
  border-radius: $acrdn-item-select-last-child-border-radius;
@@ -274,15 +274,15 @@
274
274
  border: 1px none #505050;
275
275
  border-radius: 0;
276
276
  }
277
- .e-accordion .e-active {
278
- background: #484848;
279
- }
280
277
  .e-accordion .e-acrdn-item {
281
278
  border-color: #505050;
282
279
  border-style: solid;
283
280
  border-width: 0;
284
281
  border-radius: 4px;
285
282
  }
283
+ .e-accordion .e-acrdn-item.e-active {
284
+ background: #484848;
285
+ }
286
286
  .e-accordion .e-acrdn-item.e-select:last-child {
287
287
  border-bottom: 1px solid #505050;
288
288
  border-radius: 4px;
@@ -275,15 +275,15 @@
275
275
  border: 1px none #ddd;
276
276
  border-radius: 0;
277
277
  }
278
- .e-accordion .e-active {
279
- background: #fff;
280
- }
281
278
  .e-accordion .e-acrdn-item {
282
279
  border-color: #ddd;
283
280
  border-style: solid;
284
281
  border-width: 0;
285
282
  border-radius: 4px;
286
283
  }
284
+ .e-accordion .e-acrdn-item.e-active {
285
+ background: #fff;
286
+ }
287
287
  .e-accordion .e-acrdn-item.e-select:last-child {
288
288
  border-bottom: 1px solid #ddd;
289
289
  border-radius: 4px;
@@ -274,15 +274,15 @@
274
274
  border: 1px solid rgba(0, 0, 0, 0.13);
275
275
  border-radius: 4px;
276
276
  }
277
- .e-accordion .e-active {
278
- background: #fff;
279
- }
280
277
  .e-accordion .e-acrdn-item {
281
278
  border-color: rgba(0, 0, 0, 0.13);
282
279
  border-style: solid;
283
280
  border-width: 0 0 1px 0;
284
281
  border-radius: 4px 4px 0 0;
285
282
  }
283
+ .e-accordion .e-acrdn-item.e-active {
284
+ background: #fff;
285
+ }
286
286
  .e-accordion .e-acrdn-item.e-select:last-child {
287
287
  border-bottom: 0;
288
288
  border-radius: 0 0 4px 4px;
@@ -276,15 +276,15 @@
276
276
  border: 1px solid #444c54;
277
277
  border-radius: 4px;
278
278
  }
279
- .e-accordion .e-active {
280
- background: #212529;
281
- }
282
279
  .e-accordion .e-acrdn-item {
283
280
  border-color: #444c54;
284
281
  border-style: solid;
285
282
  border-width: 0 0 1px 0;
286
283
  border-radius: 0;
287
284
  }
285
+ .e-accordion .e-acrdn-item.e-active {
286
+ background: #212529;
287
+ }
288
288
  .e-accordion .e-acrdn-item.e-select:last-child {
289
289
  border-bottom: 0;
290
290
  border-radius: 0;
@@ -276,15 +276,15 @@
276
276
  border: 1px solid #dee2e6;
277
277
  border-radius: 4px;
278
278
  }
279
- .e-accordion .e-active {
280
- background: #fff;
281
- }
282
279
  .e-accordion .e-acrdn-item {
283
280
  border-color: #dee2e6;
284
281
  border-style: solid;
285
282
  border-width: 0 0 1px 0;
286
283
  border-radius: 0;
287
284
  }
285
+ .e-accordion .e-acrdn-item.e-active {
286
+ background: #fff;
287
+ }
288
288
  .e-accordion .e-acrdn-item.e-select:last-child {
289
289
  border-bottom: 0;
290
290
  border-radius: 0;
@@ -274,15 +274,15 @@
274
274
  border: 1px solid #414040;
275
275
  border-radius: 0;
276
276
  }
277
- .e-accordion .e-active {
278
- background: #201f1f;
279
- }
280
277
  .e-accordion .e-acrdn-item {
281
278
  border-color: #201f1f;
282
279
  border-style: solid;
283
280
  border-width: 1px 0 1px 0;
284
281
  border-radius: 0;
285
282
  }
283
+ .e-accordion .e-acrdn-item.e-active {
284
+ background: #201f1f;
285
+ }
286
286
  .e-accordion .e-acrdn-item.e-select:last-child {
287
287
  border-bottom: 1px solid #201f1f;
288
288
  border-radius: 0;
@@ -275,15 +275,15 @@
275
275
  border: 1px solid #eaeaea;
276
276
  border-radius: 0;
277
277
  }
278
- .e-accordion .e-active {
279
- background: #fff;
280
- }
281
278
  .e-accordion .e-acrdn-item {
282
279
  border-color: #fff;
283
280
  border-style: solid;
284
281
  border-width: 1px 0 1px 0;
285
282
  border-radius: 0;
286
283
  }
284
+ .e-accordion .e-acrdn-item.e-active {
285
+ background: #fff;
286
+ }
287
287
  .e-accordion .e-acrdn-item.e-select:last-child {
288
288
  border-bottom: 1px solid #fff;
289
289
  border-radius: 0;