@syncfusion/ej2-lists 20.4.42 → 20.4.48

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 : 20.4.42
3
+ * version : 20.4.48
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-lists@*",
3
- "_id": "@syncfusion/ej2-lists@20.4.40",
3
+ "_id": "@syncfusion/ej2-lists@20.4.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-fv3jQJnoT5EG0BV9SZrVitrFHm3roa68uhebcqWn+0FEJHcvSG/0Qh3zXF5A9bAnVDnh/6J181Uc7o5okKD69A==",
5
+ "_integrity": "sha512-2La83YlYGEdCGj7rnTKtbpy/KwSY5hTMHZsgO9RBFu+sgqQvSioVITbYbr7M4RnyaYowC4oZ4on8kD9ZvFtQyA==",
6
6
  "_location": "/@syncfusion/ej2-lists",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -34,8 +34,8 @@
34
34
  "/@syncfusion/ej2-schedule",
35
35
  "/@syncfusion/ej2-vue-lists"
36
36
  ],
37
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-lists/-/ej2-lists-20.4.40.tgz",
38
- "_shasum": "255209a08f0156984ba397db78102e6f0401c4a7",
37
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-lists/-/ej2-lists-20.4.42.tgz",
38
+ "_shasum": "3d1612610d03d1797fe903ec06ebd6bebac4b5b6",
39
39
  "_spec": "@syncfusion/ej2-lists@*",
40
40
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
41
41
  "author": {
@@ -43,9 +43,9 @@
43
43
  },
44
44
  "bundleDependencies": false,
45
45
  "dependencies": {
46
- "@syncfusion/ej2-base": "~20.4.42",
47
- "@syncfusion/ej2-buttons": "~20.4.42",
48
- "@syncfusion/ej2-data": "~20.4.42"
46
+ "@syncfusion/ej2-base": "~20.4.48",
47
+ "@syncfusion/ej2-buttons": "~20.4.48",
48
+ "@syncfusion/ej2-data": "~20.4.48"
49
49
  },
50
50
  "deprecated": false,
51
51
  "description": "The listview control allows you to select an item or multiple items from a list-like interface and represents the data in interactive hierarchical structure across different layouts or views.",
@@ -85,7 +85,7 @@
85
85
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/lists"
86
86
  },
87
87
  "typings": "index.d.ts",
88
- "version": "20.4.42",
88
+ "version": "20.4.48",
89
89
  "sideEffects": false,
90
90
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
91
91
  }
@@ -487,6 +487,7 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
487
487
  */
488
488
  selectMultipleItems(item: Fields[] | HTMLElement[] | Element[]): void;
489
489
  private getParentId;
490
+ private updateSelectedId;
490
491
  /**
491
492
  * Gets the details of the currently selected item from the list items.
492
493
  *
@@ -441,7 +441,7 @@ var ListView = /** @class */ (function (_super) {
441
441
  this.currentLiElements = [];
442
442
  this.isNestedList = false;
443
443
  this.selectedData = [];
444
- this.selectedId = [];
444
+ this.selectedId = this.enablePersistence ? this.selectedId : [];
445
445
  this.LISTVIEW_TEMPLATE_ID = "" + this.element.id + LISTVIEW_TEMPLATE_PROPERTY;
446
446
  this.LISTVIEW_GROUPTEMPLATE_ID = "" + this.element.id + LISTVIEW_GROUPTEMPLATE_PROPERTY;
447
447
  this.LISTVIEW_HEADERTEMPLATE_ID = "" + this.element.id + LISTVIEW_HEADERTEMPLATE_PROPERTY;
@@ -453,12 +453,13 @@ var ListView = /** @class */ (function (_super) {
453
453
  this.curUL = this.ulElement = this.liCollection = this.headerEle = this.contentContainer = undefined;
454
454
  };
455
455
  ListView.prototype.renderCheckbox = function (args) {
456
+ var _this = this;
456
457
  if (args.item.classList.contains(classNames.hasChild)) {
457
458
  this.isNestedList = true;
458
459
  }
459
460
  if (this.showCheckBox && this.isValidLI(args.item)) {
460
461
  var checkboxElement = void 0;
461
- var fieldData = void 0;
462
+ var fieldData_1;
462
463
  // eslint-disable-next-line prefer-const
463
464
  checkboxElement = createCheckBox(this.createElement, false, {
464
465
  checked: false, enableRtl: this.enableRtl,
@@ -469,8 +470,14 @@ var ListView = /** @class */ (function (_super) {
469
470
  args.item.classList.add(classNames.itemCheckList);
470
471
  args.item.firstElementChild.classList.add(classNames.checkbox);
471
472
  if (typeof this.dataSource[0] !== 'string' && typeof this.dataSource[0] !== 'number') {
472
- fieldData = getFieldValues(args.curData, this.listBaseOption.fields);
473
- if (fieldData[this.listBaseOption.fields.isChecked]) {
473
+ fieldData_1 = getFieldValues(args.curData, this.listBaseOption.fields);
474
+ if (this.enablePersistence && !isNullOrUndefined(this.selectedId)) {
475
+ var index = this.selectedId.findIndex(function (e) { return e == fieldData_1[_this.listBaseOption.fields.id].toString(); });
476
+ if (index != -1) {
477
+ this.checkInternally(args, checkboxElement);
478
+ }
479
+ }
480
+ else if (fieldData_1[this.listBaseOption.fields.isChecked]) {
474
481
  this.checkInternally(args, checkboxElement);
475
482
  }
476
483
  }
@@ -535,6 +542,7 @@ var ListView = /** @class */ (function (_super) {
535
542
  checkboxIcon.parentElement.setAttribute('aria-checked', checked ? 'true' : 'false');
536
543
  }
537
544
  this.setSelectedItemData(liElement);
545
+ this.updateSelectedId();
538
546
  }
539
547
  };
540
548
  /**
@@ -577,6 +585,7 @@ var ListView = /** @class */ (function (_super) {
577
585
  if (this.enableVirtualization) {
578
586
  this.virtualizationModule.checkedItem(checked);
579
587
  }
588
+ this.updateSelectedId();
580
589
  }
581
590
  };
582
591
  ListView.prototype.setCheckbox = function () {
@@ -692,6 +701,7 @@ var ListView = /** @class */ (function (_super) {
692
701
  }
693
702
  }
694
703
  }
704
+ this.updateSelectedId();
695
705
  };
696
706
  ListView.prototype.removeElement = function (element) {
697
707
  return element && element.parentNode && element.parentNode.removeChild(element);
@@ -881,6 +891,7 @@ var ListView = /** @class */ (function (_super) {
881
891
  var eventArgs = this.selectEventData(li, e);
882
892
  merge(eventArgs, { isChecked: checkIcon ? checkIcon.classList.contains(classNames.checked) : false });
883
893
  this.trigger('select', eventArgs);
894
+ this.updateSelectedId();
884
895
  }
885
896
  };
886
897
  ListView.prototype.keyActionHandler = function (e) {
@@ -1557,6 +1568,16 @@ var ListView = /** @class */ (function (_super) {
1557
1568
  }
1558
1569
  return parentId;
1559
1570
  };
1571
+ ListView.prototype.updateSelectedId = function () {
1572
+ this.selectedId = [];
1573
+ var liCollection = this.curUL.getElementsByClassName(classNames.selected);
1574
+ for (var i = 0; i < liCollection.length; i++) {
1575
+ var tempData = this.getItemData(liCollection[i]);
1576
+ if (tempData[this.listBaseOption.fields.id]) {
1577
+ this.selectedId.push(tempData[this.listBaseOption.fields.id]);
1578
+ }
1579
+ }
1580
+ };
1560
1581
  /**
1561
1582
  * Gets the details of the currently selected item from the list items.
1562
1583
  *
@@ -1991,7 +2012,7 @@ var ListView = /** @class */ (function (_super) {
1991
2012
  ListView.prototype.getPersistData = function () {
1992
2013
  return this.addOnPersist(['cssClass', 'enableRtl', 'htmlAttributes',
1993
2014
  'enable', 'fields', 'animation', 'headerTitle',
1994
- 'sortOrder', 'showIcon', 'height', 'width', 'showCheckBox', 'checkBoxPosition']);
2015
+ 'sortOrder', 'showIcon', 'height', 'width', 'showCheckBox', 'checkBoxPosition', 'selectedId']);
1995
2016
  };
1996
2017
  __decorate([
1997
2018
  Property('')