@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.
@@ -3266,6 +3266,17 @@ var ListView = /** @__PURE__ @class */ (function (_super) {
3266
3266
  return ListView;
3267
3267
  }(Component));
3268
3268
 
3269
+ var __assign = (undefined && undefined.__assign) || function () {
3270
+ __assign = Object.assign || function(t) {
3271
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
3272
+ s = arguments[i];
3273
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
3274
+ t[p] = s[p];
3275
+ }
3276
+ return t;
3277
+ };
3278
+ return __assign.apply(this, arguments);
3279
+ };
3269
3280
  var listElementCount = 1.5;
3270
3281
  var windowElementCount = 3;
3271
3282
  var Virtualization = /** @__PURE__ @class */ (function () {
@@ -4078,6 +4089,7 @@ var Virtualization = /** @__PURE__ @class */ (function () {
4078
4089
  }
4079
4090
  }
4080
4091
  }
4092
+ this.setItemContext(args.item, args.curData, !!args.curData.isHeader);
4081
4093
  };
4082
4094
  Virtualization.prototype.reRenderUiVirtualization = function () {
4083
4095
  this.wireScrollEvent(true);
@@ -4098,9 +4110,12 @@ var Virtualization = /** @__PURE__ @class */ (function () {
4098
4110
  element.dataset.uid = (curViewDS[this.listViewInstance.fields.id]) ?
4099
4111
  (curViewDS[this.listViewInstance.fields.id]) : ListBase.generateId();
4100
4112
  onChange(curViewDS, element, this);
4113
+ this.setItemContext(element, curViewDS, !!curViewDS.isHeader);
4101
4114
  }
4102
4115
  else {
4103
4116
  this.updateUiContent(element, index);
4117
+ var curViewDS = this.listViewInstance.curViewDS[index];
4118
+ this.setItemContext(element, curViewDS, !!curViewDS.isHeader);
4104
4119
  }
4105
4120
  this.changeElementAttributes(element, index);
4106
4121
  if (targetElement) {
@@ -4126,6 +4141,7 @@ var Virtualization = /** @__PURE__ @class */ (function () {
4126
4141
  [].slice.call(liItem[0].children).forEach(function (ele) {
4127
4142
  listElement.appendChild(ele);
4128
4143
  });
4144
+ virtualThis.setItemContext(listElement, newData, !!newData.isHeader);
4129
4145
  };
4130
4146
  Virtualization.prototype.onNgChange = function (newData, listElement, virtualThis) {
4131
4147
  // compile given target element with template for new data
@@ -4135,6 +4151,7 @@ var Virtualization = /** @__PURE__ @class */ (function () {
4135
4151
  listElement.removeChild(listElement.lastChild);
4136
4152
  }
4137
4153
  listElement.appendChild(resultElement[0]);
4154
+ virtualThis.setItemContext(listElement, newData, !!newData.isHeader);
4138
4155
  };
4139
4156
  Virtualization.prototype.getModuleName = function () {
4140
4157
  return 'virtualization';
@@ -4144,6 +4161,14 @@ var Virtualization = /** @__PURE__ @class */ (function () {
4144
4161
  this.topElement = null;
4145
4162
  this.bottomElement = null;
4146
4163
  };
4164
+ Virtualization.prototype.setItemContext = function (item, curData, isHeader) {
4165
+ var el = item;
4166
+ var existing = (el.context || {});
4167
+ el.context = __assign({}, existing, { data: curData, nodes: existing.nodes || { flatTemplateNodes: [], groupTemplateNodes: [] }, type: isHeader ? 'groupList' : 'flatList' });
4168
+ if (item.firstElementChild) {
4169
+ el.context.template = item.firstElementChild;
4170
+ }
4171
+ };
4147
4172
  return Virtualization;
4148
4173
  }());
4149
4174