@syncfusion/ej2-navigations 26.1.40 → 26.1.41

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 26.1.40
3
+ * version : 26.1.41
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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@26.1.39",
3
+ "_id": "@syncfusion/ej2-navigations@26.1.40",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-nx8+3jGZTNQzQ7xIiwKyB2wum+nmP+eQF+ljJ/+vvhn54c2b3WkGTcANpvKFQ2NluOytjU894S7QBFx4fXeV4Q==",
5
+ "_integrity": "sha512-bNvzAXiKLPBSAqfAAuSU83QR22+MmChfjd4/Zo68LP5DmXA3C10ktVjZFInWidVM3YCHzZIPjl5yroIp3MEDzQ==",
6
6
  "_location": "/@syncfusion/ej2-navigations",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -39,8 +39,8 @@
39
39
  "/@syncfusion/ej2-spreadsheet",
40
40
  "/@syncfusion/ej2-vue-navigations"
41
41
  ],
42
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-26.1.39.tgz",
43
- "_shasum": "60cc3aeedd220788eee7250f705c8c5fa2c0f34f",
42
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-26.1.40.tgz",
43
+ "_shasum": "b8be523a6913f09ca49e23192f9dacec5d434972",
44
44
  "_spec": "@syncfusion/ej2-navigations@*",
45
45
  "_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
46
46
  "author": {
@@ -53,10 +53,10 @@
53
53
  "dependencies": {
54
54
  "@syncfusion/ej2-base": "~26.1.37",
55
55
  "@syncfusion/ej2-buttons": "~26.1.40",
56
- "@syncfusion/ej2-data": "~26.1.40",
57
- "@syncfusion/ej2-inputs": "~26.1.40",
56
+ "@syncfusion/ej2-data": "~26.1.41",
57
+ "@syncfusion/ej2-inputs": "~26.1.41",
58
58
  "@syncfusion/ej2-lists": "~26.1.35",
59
- "@syncfusion/ej2-popups": "~26.1.38"
59
+ "@syncfusion/ej2-popups": "~26.1.41"
60
60
  },
61
61
  "deprecated": false,
62
62
  "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",
@@ -161,6 +161,6 @@
161
161
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
162
162
  },
163
163
  "typings": "index.d.ts",
164
- "version": "26.1.40",
164
+ "version": "26.1.41",
165
165
  "sideEffects": false
166
166
  }
@@ -291,6 +291,7 @@ export declare class Stepper extends StepperBase implements INotifyPropertyChang
291
291
  private updateAnimation;
292
292
  private updateStepType;
293
293
  private wireEvents;
294
+ private unWireEvents;
294
295
  private updateStepFocus;
295
296
  private updateStepperStatus;
296
297
  private updateStatusClass;
@@ -323,10 +324,36 @@ export declare class Stepper extends StepperBase implements INotifyPropertyChang
323
324
  private navigationHandler;
324
325
  private updateStepInteractions;
325
326
  private removeItemElements;
327
+ /**
328
+ * Move to next step from current step in Stepper.
329
+ *
330
+ * @returns {void}
331
+ */
326
332
  nextStep(): void;
333
+ /**
334
+ * Move to previous step from current step in Stepper.
335
+ *
336
+ * @returns {void}
337
+ */
327
338
  previousStep(): void;
339
+ /**
340
+ * Reset the state of the Stepper and move to the first step.
341
+ *
342
+ * @returns {void}
343
+ */
328
344
  reset(): void;
345
+ /**
346
+ * Refreshes the position of the progress bar programmatically when the dimensions of the parent container are changed.
347
+ *
348
+ * @returns {void}
349
+ */
350
+ refreshProgressbar(): void;
329
351
  private updateElementClassArray;
352
+ /**
353
+ * Destroy the stepper control.
354
+ *
355
+ * @returns {void}
356
+ */
330
357
  destroy(): void;
331
358
  private wireKeyboardEvent;
332
359
  private keyActionHandler;
@@ -258,9 +258,19 @@ var Stepper = /** @class */ (function (_super) {
258
258
  if (_this.stepperItemList && _this.progressbar && _this.element.classList.contains(HORIZSTEP)) {
259
259
  _this.setProgressPosition(_this.element, true);
260
260
  }
261
+ _this.navigateToStep(_this.activeStep, null, null, false);
261
262
  }, this);
262
263
  EventHandler.add(window, 'click', function () { _this.updateStepFocus(); }, this);
263
264
  };
265
+ Stepper.prototype.unWireEvents = function () {
266
+ var _this = this;
267
+ EventHandler.remove(window, 'resize', function () {
268
+ if (_this.stepperItemList && _this.progressbar && _this.element.classList.contains(HORIZSTEP)) {
269
+ _this.setProgressPosition(_this.element, true);
270
+ }
271
+ });
272
+ EventHandler.remove(window, 'click', function () { _this.updateStepFocus(); });
273
+ };
264
274
  Stepper.prototype.updateStepFocus = function () {
265
275
  if (this.isKeyNavFocus) {
266
276
  this.isKeyNavFocus = false;
@@ -924,16 +934,31 @@ var Stepper = /** @class */ (function (_super) {
924
934
  }
925
935
  this.stepperItemElements = [];
926
936
  };
937
+ /**
938
+ * Move to next step from current step in Stepper.
939
+ *
940
+ * @returns {void}
941
+ */
927
942
  Stepper.prototype.nextStep = function () {
928
943
  if (this.activeStep !== this.steps.length - 1) {
929
944
  this.navigateToStep(this.activeStep + 1, null, null, false);
930
945
  }
931
946
  };
947
+ /**
948
+ * Move to previous step from current step in Stepper.
949
+ *
950
+ * @returns {void}
951
+ */
932
952
  Stepper.prototype.previousStep = function () {
933
953
  if (this.activeStep > 0) {
934
954
  this.navigateToStep(this.activeStep - 1, null, null, false);
935
955
  }
936
956
  };
957
+ /**
958
+ * Reset the state of the Stepper and move to the first step.
959
+ *
960
+ * @returns {void}
961
+ */
937
962
  Stepper.prototype.reset = function () {
938
963
  if (this.activeStep === 0) {
939
964
  this.updateStepInteractions();
@@ -943,18 +968,30 @@ var Stepper = /** @class */ (function (_super) {
943
968
  this.navigateToStep(isDisabled ? -1 : 0, null, null, false);
944
969
  }
945
970
  };
971
+ /**
972
+ * Refreshes the position of the progress bar programmatically when the dimensions of the parent container are changed.
973
+ *
974
+ * @returns {void}
975
+ */
976
+ Stepper.prototype.refreshProgressbar = function () {
977
+ if (this.stepperItemList && this.progressbar) {
978
+ this.setProgressPosition(this.element);
979
+ }
980
+ this.navigateToStep(this.activeStep, null, null, false);
981
+ };
946
982
  Stepper.prototype.updateElementClassArray = function () {
947
983
  var classArray = [RTL, READONLY, 'e-steps-focus', LABELAFTER, LABELBEFORE, 'e-label-top',
948
984
  'e-label-bottom', 'e-label-start', 'e-label-end', STEPINDICATOR, LABELINDICATOR, VERTICALSTEP, HORIZSTEP, LINEARSTEP];
949
985
  removeClass([this.element], classArray);
950
986
  };
987
+ /**
988
+ * Destroy the stepper control.
989
+ *
990
+ * @returns {void}
991
+ */
951
992
  Stepper.prototype.destroy = function () {
952
- var _this = this;
953
993
  _super.prototype.destroy.call(this);
954
- EventHandler.remove(window, 'resize', function () { if (_this.stepperItemList && _this.progressbar) {
955
- _this.setProgressPosition(_this.element, true);
956
- } });
957
- EventHandler.remove(window, 'click', function () { _this.updateStepFocus(); });
994
+ this.unWireEvents();
958
995
  // unwires the events and detach the li elements
959
996
  this.removeItemElements();
960
997
  this.clearTemplate();
@@ -253,6 +253,8 @@ export declare class Toolbar extends Component<HTMLElement> implements INotifyPr
253
253
  private isVertical;
254
254
  private tempId;
255
255
  private isExtendedOpen;
256
+ private clickEvent;
257
+ private scrollEvent;
256
258
  private resizeContext;
257
259
  private orientationChangeContext;
258
260
  /**
@@ -295,8 +295,10 @@ var Toolbar = /** @class */ (function (_super) {
295
295
  this.unwireKeyboardEvent();
296
296
  window.removeEventListener('resize', this.resizeContext);
297
297
  window.removeEventListener('orientationchange', this.orientationChangeContext);
298
- EventHandler.remove(document, 'scroll', this.docEvent);
299
- EventHandler.remove(document, 'click', this.docEvent);
298
+ document.removeEventListener('scroll', this.clickEvent);
299
+ document.removeEventListener('click', this.scrollEvent);
300
+ this.scrollEvent = null;
301
+ this.clickEvent = null;
300
302
  };
301
303
  Toolbar.prototype.clearProperty = function () {
302
304
  this.tbarEle = [];
@@ -695,6 +697,8 @@ var Toolbar = /** @class */ (function (_super) {
695
697
  this.initialize();
696
698
  this.renderControl();
697
699
  this.wireEvents();
700
+ this.clickEvent = this.docEvent.bind(this);
701
+ this.scrollEvent = this.docEvent.bind(this);
698
702
  this.renderComplete();
699
703
  if (this.isReact && this.portals && this.portals.length > 0) {
700
704
  this.renderReactTemplates(function () {
@@ -1080,8 +1084,8 @@ var Toolbar = /** @class */ (function (_super) {
1080
1084
  popup.offsetX = 0;
1081
1085
  }
1082
1086
  popup.appendTo(ele);
1083
- EventHandler.add(document, 'scroll', this.docEvent.bind(this));
1084
- EventHandler.add(document, 'click ', this.docEvent.bind(this));
1087
+ document.addEventListener('scroll', this.clickEvent);
1088
+ document.addEventListener('click', this.scrollEvent);
1085
1089
  if (this.overflowMode !== 'Extended') {
1086
1090
  popup.element.style.maxHeight = popup.element.offsetHeight + 'px';
1087
1091
  }
@@ -546,6 +546,8 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
546
546
  private isRightClick;
547
547
  private mouseDownStatus;
548
548
  private isDropIn;
549
+ private DDTTreeData;
550
+ private OldCheckedData;
549
551
  /**
550
552
  * Indicates whether the TreeView allows drag and drop of nodes. To drag and drop a node in
551
553
  * desktop, hold the mouse on the node, drag it to the target node and drop the node by releasing
@@ -1105,6 +1107,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1105
1107
  private selectGivenNodes;
1106
1108
  private clickHandler;
1107
1109
  private nodeCheckedEvent;
1110
+ private updateOldCheckedData;
1108
1111
  private triggerClickEvent;
1109
1112
  private expandNode;
1110
1113
  private expandedNode;
@@ -219,6 +219,7 @@ var TreeView = /** @class */ (function (_super) {
219
219
  _this.isRightClick = false;
220
220
  _this.mouseDownStatus = false;
221
221
  _this.isDropIn = false;
222
+ _this.OldCheckedData = [];
222
223
  return _this;
223
224
  }
224
225
  TreeView_1 = TreeView;
@@ -292,6 +293,7 @@ var TreeView = /** @class */ (function (_super) {
292
293
  this.expandChildren = [];
293
294
  this.index = 0;
294
295
  this.setTouchClass();
296
+ this.DDTTreeData = JSON.parse(JSON.stringify(this.fields.dataSource));
295
297
  if (isNOU(this.selectedNodes)) {
296
298
  this.setProperties({ selectedNodes: [] }, true);
297
299
  }
@@ -670,23 +672,38 @@ var TreeView = /** @class */ (function (_super) {
670
672
  TreeView.prototype.updateParentCheckState = function () {
671
673
  var indeterminate = selectAll('.' + INDETERMINATE, this.element);
672
674
  var childCheckedElement;
675
+ var data = this.treeData;
676
+ if (this.element.classList.contains('e-filtering')) {
677
+ data = this.DDTTreeData;
678
+ }
673
679
  for (var i = 0; i < indeterminate.length; i++) {
674
680
  var node = closest(indeterminate[parseInt(i.toString(), 10)], '.' + LISTITEM);
675
681
  var nodeId = node.getAttribute('data-uid').toString();
682
+ var OldCheckedNodes = void 0;
683
+ if (this.element.classList.contains('e-filtering')) {
684
+ OldCheckedNodes = new DataManager(this.OldCheckedData).executeLocal(new Query().where('parentID', 'equal', nodeId, true));
685
+ }
676
686
  if (this.dataType === 1) {
677
- childCheckedElement = new DataManager(this.treeData).
687
+ childCheckedElement = new DataManager(data).
678
688
  executeLocal(new Query().where(this.fields.parentID, 'equal', nodeId, true));
679
689
  }
680
690
  else {
681
- childCheckedElement = this.getChildNodes(this.treeData, nodeId);
691
+ childCheckedElement = this.getChildNodes(data, nodeId);
682
692
  }
683
693
  var count = 0;
684
694
  if (childCheckedElement) {
685
- for (var j = 0; j < childCheckedElement.length; j++) {
686
- var childId = childCheckedElement[parseInt(j.toString(), 10)][this.fields.id].toString();
687
- if (this.checkedNodes.indexOf(childId) !== -1) {
695
+ var _loop_1 = function (j) {
696
+ var childId = childCheckedElement[parseInt(j.toString(), 10)][this_1.fields.id].toString();
697
+ if (this_1.checkedNodes.indexOf(childId) !== -1) {
698
+ count++;
699
+ }
700
+ else if (this_1.element.classList.contains('e-filtering') && OldCheckedNodes.findIndex(function (e) { return e['id'] === childId; }) !== -1) {
688
701
  count++;
689
702
  }
703
+ };
704
+ var this_1 = this;
705
+ for (var j = 0; j < childCheckedElement.length; j++) {
706
+ _loop_1(j);
690
707
  }
691
708
  if (count === childCheckedElement.length) {
692
709
  var nodeCheck = node.getAttribute('data-uid');
@@ -966,13 +983,28 @@ var TreeView = /** @class */ (function (_super) {
966
983
  var indeterminateNodes = selectAll('.' + INDETERMINATE, ulElement);
967
984
  var nodes = selectAll('.' + LISTITEM, ulElement);
968
985
  var checkBoxEle = element.getElementsByClassName(CHECKBOXWRAP)[0];
969
- if (nodes.length === checkedNodes.length) {
986
+ var count = nodes.length;
987
+ var checkedCount = checkedNodes.length;
988
+ var dataUid = element.getAttribute('data-uid');
989
+ if (this.element.classList.contains('e-filtering')) {
990
+ var oldCheckedNodes = new DataManager(this.OldCheckedData).executeLocal(new Query().where('parentID', 'equal', dataUid, true));
991
+ checkedCount = oldCheckedNodes.length;
992
+ var childItems = [];
993
+ if (this.dataType === 1) {
994
+ childItems = new DataManager(this.DDTTreeData).executeLocal(new Query().where(this.fields.parentID, 'equal', dataUid, true));
995
+ }
996
+ else {
997
+ childItems = this.getChildNodes(this.DDTTreeData, dataUid);
998
+ }
999
+ count = childItems.length;
1000
+ }
1001
+ if (count === checkedCount) {
970
1002
  this.changeState(checkBoxEle, 'check', null, true, true);
971
1003
  }
972
- else if (checkedNodes.length > 0 || indeterminateNodes.length > 0) {
1004
+ else if (checkedCount > 0 || indeterminateNodes.length > 0) {
973
1005
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
974
1006
  }
975
- else if (checkedNodes.length === 0) {
1007
+ else if (checkedCount === 0) {
976
1008
  this.changeState(checkBoxEle, 'uncheck', null, true, true);
977
1009
  }
978
1010
  var parentUL = closest(element, '.' + PARENTITEM);
@@ -1608,6 +1640,25 @@ var TreeView = /** @class */ (function (_super) {
1608
1640
  eventArgs.data = eventArgs.data.splice(0, eventArgs.data.length - 1);
1609
1641
  this.trigger('nodeChecked', eventArgs);
1610
1642
  };
1643
+ TreeView.prototype.updateOldCheckedData = function (data) {
1644
+ var dataManager = new DataManager(data);
1645
+ var childItems = dataManager.executeLocal(new Query().where('isChecked', 'equal', 'true', true));
1646
+ var uncheckedItems = dataManager.executeLocal(new Query().where('isChecked', 'equal', 'false', true));
1647
+ if (uncheckedItems.length > 0) {
1648
+ var index = this.OldCheckedData.findIndex(function (e) { return e['id'] === uncheckedItems[0]['id']; });
1649
+ if (index !== -1) {
1650
+ this.OldCheckedData.splice(index, 1);
1651
+ return;
1652
+ }
1653
+ }
1654
+ if (childItems.length > 0) {
1655
+ var index = this.OldCheckedData.findIndex(function (e) { return e['id'] === childItems[0]['id']; });
1656
+ if (index === -1) {
1657
+ this.OldCheckedData.push(childItems[0]);
1658
+ return;
1659
+ }
1660
+ }
1661
+ };
1611
1662
  TreeView.prototype.triggerClickEvent = function (e, li) {
1612
1663
  var eventArgs = {
1613
1664
  event: e,
@@ -2461,6 +2512,7 @@ var TreeView = /** @class */ (function (_super) {
2461
2512
  this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true);
2462
2513
  if (this.autoCheck) {
2463
2514
  this.ensureChildCheckState(li);
2515
+ this.updateOldCheckedData([this.getNodeData(li)]);
2464
2516
  this.ensureParentCheckState(closest(closest(li, '.' + PARENTITEM), '.' + LISTITEM));
2465
2517
  var doCheck = void 0;
2466
2518
  if (eventArgs.action === 'check') {
@@ -4836,6 +4888,9 @@ var TreeView = /** @class */ (function (_super) {
4836
4888
  this.initialRender = true;
4837
4889
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4838
4890
  if (!this.isReact || this.isReact && !(this.fields.dataSource instanceof DataManager)) {
4891
+ if (!this.element.classList.contains('e-filtering')) {
4892
+ this.DDTTreeData = JSON.parse(JSON.stringify(this.fields.dataSource));
4893
+ }
4839
4894
  this.reRenderNodes();
4840
4895
  }
4841
4896
  this.initialRender = false;