@syncfusion/ej2-lists 20.4.48 → 21.1.35

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.
@@ -443,11 +443,11 @@ var ListBase;
443
443
  var grpItem = {};
444
444
  var hdr = 'isHeader';
445
445
  grpItem[curFields.text] = ds[j].key;
446
- grpItem[hdr] = true;
446
+ grpItem["" + hdr] = true;
447
447
  var newtext = curFields.text;
448
448
  if (newtext === 'id') {
449
449
  newtext = 'text';
450
- grpItem[newtext] = ds[j].key;
450
+ grpItem["" + newtext] = ds[j].key;
451
451
  }
452
452
  grpItem._id = 'group-list-item-' + (ds[j].key ?
453
453
  ds[j].key.toString().trim() : 'undefined');
@@ -706,7 +706,7 @@ var ListBase;
706
706
  for (var _i = 0, headerItems_1 = headerItems; _i < headerItems_1.length; _i++) {
707
707
  var header = headerItems_1[_i];
708
708
  var headerData = {};
709
- headerData[category] = header.textContent;
709
+ headerData["" + category] = header.textContent;
710
710
  header.innerHTML = '';
711
711
  if (componentInstance && componentInstance.getModuleName() !== "listview") {
712
712
  // eslint-disable-next-line
@@ -1002,11 +1002,11 @@ function getFieldValues(dataItem, fields) {
1002
1002
  else {
1003
1003
  for (var _i = 0, _a = Object.keys(fields); _i < _a.length; _i++) {
1004
1004
  var field = _a[_i];
1005
- var dataField = fields[field];
1005
+ var dataField = fields["" + field];
1006
1006
  var value = !isNullOrUndefined(dataField) &&
1007
1007
  typeof (dataField) === 'string' ? getValue(dataField, dataItem) : undefined;
1008
1008
  if (!isNullOrUndefined(value)) {
1009
- fieldData[dataField] = value;
1009
+ fieldData["" + dataField] = value;
1010
1010
  }
1011
1011
  }
1012
1012
  }
@@ -1396,7 +1396,7 @@ var ListView = /** @__PURE__ @class */ (function (_super) {
1396
1396
  }
1397
1397
  else {
1398
1398
  var slideLeft = 'SlideLeft';
1399
- anim = effectsConfig[slideLeft];
1399
+ anim = effectsConfig["" + slideLeft];
1400
1400
  reverse = this.enableRtl;
1401
1401
  duration = 0;
1402
1402
  }
@@ -2204,11 +2204,11 @@ var ListView = /** @__PURE__ @class */ (function (_super) {
2204
2204
  // eslint-disable-next-line
2205
2205
  for (var _i = 0, _a = Object.keys(this.fields.properties); _i < _a.length; _i++) {
2206
2206
  var column = _a[_i];
2207
- if (column !== 'tableName' && !!(this.fields[column]) &&
2208
- this.fields[column] !==
2209
- ListBase.defaultMappedFields[column]
2210
- && columns.indexOf(this.fields[column]) === -1) {
2211
- columns.push(this.fields[column]);
2207
+ if (column !== 'tableName' && !!(this.fields["" + column]) &&
2208
+ this.fields["" + column] !==
2209
+ ListBase.defaultMappedFields["" + column]
2210
+ && columns.indexOf(this.fields["" + column]) === -1) {
2211
+ columns.push(this.fields["" + column]);
2212
2212
  }
2213
2213
  }
2214
2214
  query.select(columns);
@@ -2384,7 +2384,7 @@ var ListView = /** @__PURE__ @class */ (function (_super) {
2384
2384
  if (this.enableVirtualization) {
2385
2385
  if (Object.keys(this.dataSource).length) {
2386
2386
  if ((this.template || this.groupTemplate) && !this.virtualizationModule.isNgTemplate()) {
2387
- if (this.isReact) {
2387
+ if (this.isReact || this.isVue) {
2388
2388
  if (typeof this.template == "string") {
2389
2389
  this.listBaseOption.template = null;
2390
2390
  }
@@ -3125,6 +3125,14 @@ var Virtualization = /** @__PURE__ @class */ (function () {
3125
3125
  Virtualization.prototype.isNgTemplate = function () {
3126
3126
  return !isNullOrUndefined(this.listViewInstance.templateRef) && typeof this.listViewInstance.templateRef !== 'string';
3127
3127
  };
3128
+ /**
3129
+ * Checks if the platform is a Vue and its template property is a function type.
3130
+ *
3131
+ * @returns {boolean} indicating the result of the check
3132
+ */
3133
+ Virtualization.prototype.isVueFunctionTemplate = function () {
3134
+ return this.listViewInstance.isVue && typeof this.listViewInstance.template === 'function';
3135
+ };
3128
3136
  /**
3129
3137
  * For internal use only.
3130
3138
  *
@@ -3494,7 +3502,7 @@ var Virtualization = /** @__PURE__ @class */ (function () {
3494
3502
  if (this.listViewInstance.showCheckBox) {
3495
3503
  var indexArray = this.uiIndices.activeIndices;
3496
3504
  for (var i = 0; i < indexArray.length; i++) {
3497
- textCollection.push(curViewDS_2[indexArray[i]][text]);
3505
+ textCollection.push(curViewDS_2[indexArray[i]]["" + text]);
3498
3506
  // eslint-disable-next-line
3499
3507
  dataCollection.push(curViewDS_2[indexArray[i]]);
3500
3508
  }
@@ -3917,10 +3925,14 @@ var Virtualization = /** @__PURE__ @class */ (function () {
3917
3925
  this.listViewInstance.template = div.innerHTML;
3918
3926
  }
3919
3927
  }
3928
+ if (this.isVueFunctionTemplate())
3929
+ return;
3920
3930
  template.innerHTML = this.listViewInstance.template;
3921
3931
  this.listViewInstance.template = virtualTemplate;
3922
3932
  }
3923
3933
  else {
3934
+ if (this.isVueFunctionTemplate())
3935
+ return;
3924
3936
  template.innerHTML = this.listViewInstance.template || commonTemplate;
3925
3937
  }
3926
3938
  // eslint-disable-next-line
@@ -4203,7 +4215,7 @@ var Virtualization = /** @__PURE__ @class */ (function () {
4203
4215
  };
4204
4216
  Virtualization.prototype.updateUI = function (element, index, targetElement) {
4205
4217
  // eslint-disable-next-line @typescript-eslint/ban-types
4206
- var onChange = this.isNgTemplate() ? this.onNgChange : this.onChange;
4218
+ var onChange = this.isNgTemplate() ? this.onNgChange : (this.isVueFunctionTemplate()) ? this.onVueChange : this.onChange;
4207
4219
  if (this.listViewInstance.template || this.listViewInstance.groupTemplate) {
4208
4220
  var curViewDS = this.listViewInstance.curViewDS[index];
4209
4221
  // eslint-disable-next-line
@@ -4220,6 +4232,22 @@ var Virtualization = /** @__PURE__ @class */ (function () {
4220
4232
  this.listViewInstance.ulElement.insertBefore(element, targetElement);
4221
4233
  }
4222
4234
  };
4235
+ /**
4236
+ * Handles the UI change in vue for the list view.
4237
+ *
4238
+ * @param {DataSource} newData - The new data source for the list view.
4239
+ * @param {ElementContext} listElement - The HTML element context for the list view.
4240
+ * @param {Virtualization} virtualThis - The virtualization context for the list view.
4241
+ */
4242
+ Virtualization.prototype.onVueChange = function (newData, listElement, virtualThis) {
4243
+ var liItem = ListBase.createListItemFromJson(virtualThis.listViewInstance.createElement,
4244
+ // eslint-disable-next-line
4245
+ [newData], virtualThis.listViewInstance.listBaseOption, null, null, virtualThis.listViewInstance);
4246
+ while (listElement.lastChild) {
4247
+ listElement.removeChild(listElement.lastChild);
4248
+ }
4249
+ listElement.appendChild(liItem[0].firstChild);
4250
+ };
4223
4251
  Virtualization.prototype.onNgChange = function (newData, listElement, virtualThis) {
4224
4252
  // compile given target element with template for new data
4225
4253
  // eslint-disable-next-line
@@ -4266,7 +4294,6 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
4266
4294
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4267
4295
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4268
4296
  };
4269
- /* eslint-disable @typescript-eslint/no-explicit-any */
4270
4297
  /**
4271
4298
  * Sortable Module provides support to enable sortable functionality in Dom Elements.
4272
4299
  * ```html
@@ -4285,10 +4312,8 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
4285
4312
  */
4286
4313
  var Sortable = /** @__PURE__ @class */ (function (_super) {
4287
4314
  __extends$1(Sortable, _super);
4288
- /* es-lint enable */
4289
4315
  function Sortable(element, options) {
4290
4316
  var _this = _super.call(this, options, element) || this;
4291
- // eslint-disable-next-line
4292
4317
  _this.getHelper = function (e) {
4293
4318
  // eslint-disable-next-line prefer-const
4294
4319
  var target = _this.getSortableElement(e.sender.target);
@@ -4310,14 +4335,14 @@ var Sortable = /** @__PURE__ @class */ (function (_super) {
4310
4335
  };
4311
4336
  // eslint-disable-next-line
4312
4337
  _this.onDrag = function (e) {
4313
- if (!e.target)
4338
+ if (!e.target) {
4314
4339
  return;
4340
+ }
4315
4341
  _this.trigger('drag', { event: e.event, element: _this.element, target: e.target });
4316
4342
  var newInst = _this.getSortableInstance(e.target);
4317
4343
  var target = _this.getSortableElement(e.target, newInst);
4318
4344
  if ((_this.isValidTarget(target, newInst) || e.target.className.indexOf('e-list-group-item') > -1) && (_this.curTarget !== target ||
4319
- !isNullOrUndefined(newInst.placeHolder)) && (newInst.placeHolderElement ? newInst.placeHolderElement !== e.target :
4320
- true)) {
4345
+ !isNullOrUndefined(newInst.placeHolder)) && (newInst.placeHolderElement ? newInst.placeHolderElement !== e.target : true)) {
4321
4346
  if (e.target.className.indexOf('e-list-group-item') > -1) {
4322
4347
  target = e.target;
4323
4348
  }
@@ -4471,7 +4496,7 @@ var Sortable = /** @__PURE__ @class */ (function (_super) {
4471
4496
  _this.target = null;
4472
4497
  _this.curTarget = null;
4473
4498
  remove(e.helper);
4474
- getComponent(_this.element, Draggable).intDestroy(e.event);
4499
+ getComponent(_this.element, 'draggable').intDestroy(e.event);
4475
4500
  };
4476
4501
  _this.bind();
4477
4502
  return _this;