@syncfusion/ej2-lists 20.4.40 → 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.40
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.38",
3
+ "_id": "@syncfusion/ej2-lists@20.4.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-g8HbXoBoYNWShdPkOpIZfE14+YC4gTWAYMNCkNBfr2uIVCnCxgATIWVonpjc+O94bDGZQ/jRwxBcEU64moYc/g==",
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.38.tgz",
38
- "_shasum": "b2b583a6b1ac5fc36d13835fa89d4c8b0fd750a8",
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.40",
47
- "@syncfusion/ej2-buttons": "~20.4.40",
48
- "@syncfusion/ej2-data": "~20.4.40"
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.40",
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
  }
@@ -501,7 +508,6 @@ var ListView = /** @class */ (function (_super) {
501
508
  };
502
509
  ListView.prototype.checkInternally = function (args, checkboxElement) {
503
510
  args.item.classList.add(classNames.selected);
504
- args.item.setAttribute('aria-selected', 'true');
505
511
  checkboxElement.querySelector('.' + classNames.checkboxIcon).classList.add(classNames.checked);
506
512
  checkboxElement.setAttribute('aria-checked', 'true');
507
513
  };
@@ -527,7 +533,6 @@ var ListView = /** @class */ (function (_super) {
527
533
  else {
528
534
  liElement.classList.remove(classNames.selected);
529
535
  }
530
- liElement.setAttribute('aria-selected', checked ? 'true' : 'false');
531
536
  if (checked === true) {
532
537
  checkboxIcon.classList.add(classNames.checked);
533
538
  }
@@ -537,6 +542,7 @@ var ListView = /** @class */ (function (_super) {
537
542
  checkboxIcon.parentElement.setAttribute('aria-checked', checked ? 'true' : 'false');
538
543
  }
539
544
  this.setSelectedItemData(liElement);
545
+ this.updateSelectedId();
540
546
  }
541
547
  };
542
548
  /**
@@ -579,6 +585,7 @@ var ListView = /** @class */ (function (_super) {
579
585
  if (this.enableVirtualization) {
580
586
  this.virtualizationModule.checkedItem(checked);
581
587
  }
588
+ this.updateSelectedId();
582
589
  }
583
590
  };
584
591
  ListView.prototype.setCheckbox = function () {
@@ -694,6 +701,7 @@ var ListView = /** @class */ (function (_super) {
694
701
  }
695
702
  }
696
703
  }
704
+ this.updateSelectedId();
697
705
  };
698
706
  ListView.prototype.removeElement = function (element) {
699
707
  return element && element.parentNode && element.parentNode.removeChild(element);
@@ -709,9 +717,6 @@ var ListView = /** @class */ (function (_super) {
709
717
  ListView.prototype.homeKeyHandler = function (e, end) {
710
718
  e.preventDefault();
711
719
  if (Object.keys(this.dataSource).length && this.curUL) {
712
- if (this.selectedItems) {
713
- (this.selectedItems.item).setAttribute('aria-selected', 'false');
714
- }
715
720
  var li = this.curUL.querySelectorAll('.' + classNames.listItem);
716
721
  var focusedElement = this.curUL.querySelector('.' + classNames.focused) ||
717
722
  this.curUL.querySelector('.' + classNames.selected);
@@ -886,6 +891,7 @@ var ListView = /** @class */ (function (_super) {
886
891
  var eventArgs = this.selectEventData(li, e);
887
892
  merge(eventArgs, { isChecked: checkIcon ? checkIcon.classList.contains(classNames.checked) : false });
888
893
  this.trigger('select', eventArgs);
894
+ this.updateSelectedId();
889
895
  }
890
896
  };
891
897
  ListView.prototype.keyActionHandler = function (e) {
@@ -929,11 +935,10 @@ var ListView = /** @class */ (function (_super) {
929
935
  ListView.prototype.focusout = function () {
930
936
  if (Object.keys(this.dataSource).length && this.curUL) {
931
937
  var focusedElement = this.curUL.querySelector('.' + classNames.focused);
932
- var activeElement = this.curUL.querySelector('[aria-selected = true]');
933
938
  if (focusedElement) {
934
939
  focusedElement.classList.remove(classNames.focused);
935
- if (activeElement && !this.showCheckBox) {
936
- activeElement.classList.add(classNames.selected);
940
+ if (!this.showCheckBox) {
941
+ this.selectedLI.classList.add(classNames.selected);
937
942
  }
938
943
  }
939
944
  }
@@ -976,14 +981,12 @@ var ListView = /** @class */ (function (_super) {
976
981
  continue;
977
982
  }
978
983
  else {
979
- ele.setAttribute('aria-selected', 'false');
980
984
  ele.classList.remove(classNames.selected);
981
985
  }
982
986
  }
983
987
  }
984
988
  else {
985
989
  li.classList.remove(classNames.selected);
986
- li.setAttribute('aria-selected', 'false');
987
990
  }
988
991
  };
989
992
  ListView.prototype.isValidLI = function (li) {
@@ -1009,12 +1012,10 @@ var ListView = /** @class */ (function (_super) {
1009
1012
  if (!checkIcon.classList.contains(classNames.checked)) {
1010
1013
  checkIcon.classList.add(classNames.checked);
1011
1014
  li.classList.add(classNames.selected);
1012
- li.setAttribute('aria-selected', 'true');
1013
1015
  }
1014
1016
  else {
1015
1017
  checkIcon.classList.remove(classNames.checked);
1016
1018
  li.classList.remove(classNames.selected);
1017
- li.setAttribute('aria-selected', 'false');
1018
1019
  }
1019
1020
  checkboxElement.setAttribute('aria-checked', checkIcon.classList.contains(classNames.checked) ?
1020
1021
  'true' : 'false');
@@ -1081,7 +1082,6 @@ var ListView = /** @class */ (function (_super) {
1081
1082
  this.removeSelect();
1082
1083
  }
1083
1084
  li.classList.add(classNames.selected);
1084
- li.setAttribute('aria-selected', 'true');
1085
1085
  this.removeHover();
1086
1086
  this.setSelectedItemData(li);
1087
1087
  if (this.enableVirtualization) {
@@ -1303,7 +1303,6 @@ var ListView = /** @class */ (function (_super) {
1303
1303
  var element = liElements[i];
1304
1304
  if (element.classList.contains('e-list-item')) {
1305
1305
  element.setAttribute('id', this.element.id + '_' + element.getAttribute('data-uid'));
1306
- element.setAttribute('aria-selected', 'false');
1307
1306
  element.setAttribute('tabindex', '-1');
1308
1307
  }
1309
1308
  }
@@ -1468,12 +1467,8 @@ var ListView = /** @class */ (function (_super) {
1468
1467
  var li = this.element.querySelector('[data-uid=\'' + pID + '\']');
1469
1468
  li.classList.remove(classNames.disable);
1470
1469
  li.classList.add(classNames.focused);
1471
- if (this.showCheckBox && li.querySelector('.' + classNames.checkboxIcon).classList.contains(classNames.checked)) {
1472
- li.setAttribute('aria-selected', 'true');
1473
- }
1474
- else {
1470
+ if (!(this.showCheckBox && li.querySelector('.' + classNames.checkboxIcon).classList.contains(classNames.checked))) {
1475
1471
  li.classList.remove(classNames.selected);
1476
- li.setAttribute('aria-selected', 'false');
1477
1472
  }
1478
1473
  this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
1479
1474
  if (this.enableHtmlSanitizer) {
@@ -1573,6 +1568,16 @@ var ListView = /** @class */ (function (_super) {
1573
1568
  }
1574
1569
  return parentId;
1575
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
+ };
1576
1581
  /**
1577
1582
  * Gets the details of the currently selected item from the list items.
1578
1583
  *
@@ -2007,7 +2012,7 @@ var ListView = /** @class */ (function (_super) {
2007
2012
  ListView.prototype.getPersistData = function () {
2008
2013
  return this.addOnPersist(['cssClass', 'enableRtl', 'htmlAttributes',
2009
2014
  'enable', 'fields', 'animation', 'headerTitle',
2010
- 'sortOrder', 'showIcon', 'height', 'width', 'showCheckBox', 'checkBoxPosition']);
2015
+ 'sortOrder', 'showIcon', 'height', 'width', 'showCheckBox', 'checkBoxPosition', 'selectedId']);
2011
2016
  };
2012
2017
  __decorate([
2013
2018
  Property('')