@syncfusion/ej2-lists 32.1.19 → 32.1.23

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,3 +1,12 @@
1
+ /*!
2
+ * filename: index.d.ts
3
+ * version : 32.1.23
4
+ * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
1
10
  import * as _lists from '@syncfusion/ej2-lists';
2
11
 
3
12
  export declare namespace ej {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-lists",
3
- "version": "32.1.19",
3
+ "version": "32.1.23",
4
4
  "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.",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,9 +8,9 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-lists.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~32.1.19",
12
- "@syncfusion/ej2-buttons": "~32.1.19",
13
- "@syncfusion/ej2-data": "~32.1.19",
11
+ "@syncfusion/ej2-base": "~32.1.23",
12
+ "@syncfusion/ej2-buttons": "~32.1.23",
13
+ "@syncfusion/ej2-data": "~32.1.23",
14
14
  "@syncfusion/ej2-popups": "~32.1.19"
15
15
  },
16
16
  "devDependencies": {},
@@ -90,6 +90,7 @@ export declare class Virtualization {
90
90
  private onNgChange;
91
91
  getModuleName(): string;
92
92
  destroy(): void;
93
+ private setItemContext;
93
94
  }
94
95
  interface DataSource {
95
96
  [key: string]: object;
@@ -1,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { classNames } from './list-view';
2
13
  import { EventHandler, append, isNullOrUndefined, detach, compile, formatUnit, select } from '@syncfusion/ej2-base';
3
14
  import { ListBase } from '../common/list-base';
@@ -814,6 +825,7 @@ var Virtualization = /** @class */ (function () {
814
825
  }
815
826
  }
816
827
  }
828
+ this.setItemContext(args.item, args.curData, !!args.curData.isHeader);
817
829
  };
818
830
  Virtualization.prototype.reRenderUiVirtualization = function () {
819
831
  this.wireScrollEvent(true);
@@ -834,9 +846,12 @@ var Virtualization = /** @class */ (function () {
834
846
  element.dataset.uid = (curViewDS[this.listViewInstance.fields.id]) ?
835
847
  (curViewDS[this.listViewInstance.fields.id]) : ListBase.generateId();
836
848
  onChange(curViewDS, element, this);
849
+ this.setItemContext(element, curViewDS, !!curViewDS.isHeader);
837
850
  }
838
851
  else {
839
852
  this.updateUiContent(element, index);
853
+ var curViewDS = this.listViewInstance.curViewDS[index];
854
+ this.setItemContext(element, curViewDS, !!curViewDS.isHeader);
840
855
  }
841
856
  this.changeElementAttributes(element, index);
842
857
  if (targetElement) {
@@ -862,6 +877,7 @@ var Virtualization = /** @class */ (function () {
862
877
  [].slice.call(liItem[0].children).forEach(function (ele) {
863
878
  listElement.appendChild(ele);
864
879
  });
880
+ virtualThis.setItemContext(listElement, newData, !!newData.isHeader);
865
881
  };
866
882
  Virtualization.prototype.onNgChange = function (newData, listElement, virtualThis) {
867
883
  // compile given target element with template for new data
@@ -871,6 +887,7 @@ var Virtualization = /** @class */ (function () {
871
887
  listElement.removeChild(listElement.lastChild);
872
888
  }
873
889
  listElement.appendChild(resultElement[0]);
890
+ virtualThis.setItemContext(listElement, newData, !!newData.isHeader);
874
891
  };
875
892
  Virtualization.prototype.getModuleName = function () {
876
893
  return 'virtualization';
@@ -880,6 +897,14 @@ var Virtualization = /** @class */ (function () {
880
897
  this.topElement = null;
881
898
  this.bottomElement = null;
882
899
  };
900
+ Virtualization.prototype.setItemContext = function (item, curData, isHeader) {
901
+ var el = item;
902
+ var existing = (el.context || {});
903
+ el.context = __assign({}, existing, { data: curData, nodes: existing.nodes || { flatTemplateNodes: [], groupTemplateNodes: [] }, type: isHeader ? 'groupList' : 'flatList' });
904
+ if (item.firstElementChild) {
905
+ el.context.template = item.firstElementChild;
906
+ }
907
+ };
883
908
  return Virtualization;
884
909
  }());
885
910
  export { Virtualization };