@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.
@@ -442,11 +442,11 @@ var ListBase;
442
442
  const grpItem = {};
443
443
  const hdr = 'isHeader';
444
444
  grpItem[curFields.text] = ds[j].key;
445
- grpItem[hdr] = true;
445
+ grpItem[`${hdr}`] = true;
446
446
  let newtext = curFields.text;
447
447
  if (newtext === 'id') {
448
448
  newtext = 'text';
449
- grpItem[newtext] = ds[j].key;
449
+ grpItem[`${newtext}`] = ds[j].key;
450
450
  }
451
451
  grpItem._id = 'group-list-item-' + (ds[j].key ?
452
452
  ds[j].key.toString().trim() : 'undefined');
@@ -703,7 +703,7 @@ var ListBase;
703
703
  const category = curFields.groupBy;
704
704
  for (const header of headerItems) {
705
705
  const headerData = {};
706
- headerData[category] = header.textContent;
706
+ headerData[`${category}`] = header.textContent;
707
707
  header.innerHTML = '';
708
708
  if (componentInstance && componentInstance.getModuleName() !== "listview") {
709
709
  // eslint-disable-next-line
@@ -998,11 +998,11 @@ function getFieldValues(dataItem, fields) {
998
998
  }
999
999
  else {
1000
1000
  for (const field of Object.keys(fields)) {
1001
- const dataField = fields[field];
1001
+ const dataField = fields[`${field}`];
1002
1002
  const value = !isNullOrUndefined(dataField) &&
1003
1003
  typeof (dataField) === 'string' ? getValue(dataField, dataItem) : undefined;
1004
1004
  if (!isNullOrUndefined(value)) {
1005
- fieldData[dataField] = value;
1005
+ fieldData[`${dataField}`] = value;
1006
1006
  }
1007
1007
  }
1008
1008
  }
@@ -1370,7 +1370,7 @@ let ListView = class ListView extends Component {
1370
1370
  }
1371
1371
  else {
1372
1372
  const slideLeft = 'SlideLeft';
1373
- anim = effectsConfig[slideLeft];
1373
+ anim = effectsConfig[`${slideLeft}`];
1374
1374
  reverse = this.enableRtl;
1375
1375
  duration = 0;
1376
1376
  }
@@ -2170,11 +2170,11 @@ let ListView = class ListView extends Component {
2170
2170
  if (!this.query) {
2171
2171
  // eslint-disable-next-line
2172
2172
  for (const column of Object.keys(this.fields.properties)) {
2173
- if (column !== 'tableName' && !!(this.fields[column]) &&
2174
- this.fields[column] !==
2175
- ListBase.defaultMappedFields[column]
2176
- && columns.indexOf(this.fields[column]) === -1) {
2177
- columns.push(this.fields[column]);
2173
+ if (column !== 'tableName' && !!(this.fields[`${column}`]) &&
2174
+ this.fields[`${column}`] !==
2175
+ ListBase.defaultMappedFields[`${column}`]
2176
+ && columns.indexOf(this.fields[`${column}`]) === -1) {
2177
+ columns.push(this.fields[`${column}`]);
2178
2178
  }
2179
2179
  }
2180
2180
  query.select(columns);
@@ -2348,7 +2348,7 @@ let ListView = class ListView extends Component {
2348
2348
  if (this.enableVirtualization) {
2349
2349
  if (Object.keys(this.dataSource).length) {
2350
2350
  if ((this.template || this.groupTemplate) && !this.virtualizationModule.isNgTemplate()) {
2351
- if (this.isReact) {
2351
+ if (this.isReact || this.isVue) {
2352
2352
  if (typeof this.template == "string") {
2353
2353
  this.listBaseOption.template = null;
2354
2354
  }
@@ -3086,6 +3086,14 @@ class Virtualization {
3086
3086
  isNgTemplate() {
3087
3087
  return !isNullOrUndefined(this.listViewInstance.templateRef) && typeof this.listViewInstance.templateRef !== 'string';
3088
3088
  }
3089
+ /**
3090
+ * Checks if the platform is a Vue and its template property is a function type.
3091
+ *
3092
+ * @returns {boolean} indicating the result of the check
3093
+ */
3094
+ isVueFunctionTemplate() {
3095
+ return this.listViewInstance.isVue && typeof this.listViewInstance.template === 'function';
3096
+ }
3089
3097
  /**
3090
3098
  * For internal use only.
3091
3099
  *
@@ -3450,7 +3458,7 @@ class Virtualization {
3450
3458
  if (this.listViewInstance.showCheckBox) {
3451
3459
  const indexArray = this.uiIndices.activeIndices;
3452
3460
  for (let i = 0; i < indexArray.length; i++) {
3453
- textCollection.push(curViewDS[indexArray[i]][text]);
3461
+ textCollection.push(curViewDS[indexArray[i]][`${text}`]);
3454
3462
  // eslint-disable-next-line
3455
3463
  dataCollection.push(curViewDS[indexArray[i]]);
3456
3464
  }
@@ -3871,10 +3879,14 @@ class Virtualization {
3871
3879
  this.listViewInstance.template = div.innerHTML;
3872
3880
  }
3873
3881
  }
3882
+ if (this.isVueFunctionTemplate())
3883
+ return;
3874
3884
  template.innerHTML = this.listViewInstance.template;
3875
3885
  this.listViewInstance.template = virtualTemplate;
3876
3886
  }
3877
3887
  else {
3888
+ if (this.isVueFunctionTemplate())
3889
+ return;
3878
3890
  template.innerHTML = this.listViewInstance.template || commonTemplate;
3879
3891
  }
3880
3892
  // eslint-disable-next-line
@@ -4145,7 +4157,7 @@ class Virtualization {
4145
4157
  }
4146
4158
  updateUI(element, index, targetElement) {
4147
4159
  // eslint-disable-next-line @typescript-eslint/ban-types
4148
- const onChange = this.isNgTemplate() ? this.onNgChange : this.onChange;
4160
+ const onChange = this.isNgTemplate() ? this.onNgChange : (this.isVueFunctionTemplate()) ? this.onVueChange : this.onChange;
4149
4161
  if (this.listViewInstance.template || this.listViewInstance.groupTemplate) {
4150
4162
  const curViewDS = this.listViewInstance.curViewDS[index];
4151
4163
  // eslint-disable-next-line
@@ -4162,6 +4174,22 @@ class Virtualization {
4162
4174
  this.listViewInstance.ulElement.insertBefore(element, targetElement);
4163
4175
  }
4164
4176
  }
4177
+ /**
4178
+ * Handles the UI change in vue for the list view.
4179
+ *
4180
+ * @param {DataSource} newData - The new data source for the list view.
4181
+ * @param {ElementContext} listElement - The HTML element context for the list view.
4182
+ * @param {Virtualization} virtualThis - The virtualization context for the list view.
4183
+ */
4184
+ onVueChange(newData, listElement, virtualThis) {
4185
+ let liItem = ListBase.createListItemFromJson(virtualThis.listViewInstance.createElement,
4186
+ // eslint-disable-next-line
4187
+ [newData], virtualThis.listViewInstance.listBaseOption, null, null, virtualThis.listViewInstance);
4188
+ while (listElement.lastChild) {
4189
+ listElement.removeChild(listElement.lastChild);
4190
+ }
4191
+ listElement.appendChild(liItem[0].firstChild);
4192
+ }
4165
4193
  onNgChange(newData, listElement, virtualThis) {
4166
4194
  // compile given target element with template for new data
4167
4195
  // eslint-disable-next-line
@@ -4195,7 +4223,6 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
4195
4223
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4196
4224
  };
4197
4225
  var Sortable_1;
4198
- /* eslint-disable @typescript-eslint/no-explicit-any */
4199
4226
  /**
4200
4227
  * Sortable Module provides support to enable sortable functionality in Dom Elements.
4201
4228
  * ```html
@@ -4213,10 +4240,8 @@ var Sortable_1;
4213
4240
  * ```
4214
4241
  */
4215
4242
  let Sortable = Sortable_1 = class Sortable extends Base {
4216
- /* es-lint enable */
4217
4243
  constructor(element, options) {
4218
4244
  super(options, element);
4219
- // eslint-disable-next-line
4220
4245
  this.getHelper = (e) => {
4221
4246
  // eslint-disable-next-line prefer-const
4222
4247
  let target = this.getSortableElement(e.sender.target);
@@ -4238,14 +4263,14 @@ let Sortable = Sortable_1 = class Sortable extends Base {
4238
4263
  };
4239
4264
  // eslint-disable-next-line
4240
4265
  this.onDrag = (e) => {
4241
- if (!e.target)
4266
+ if (!e.target) {
4242
4267
  return;
4268
+ }
4243
4269
  this.trigger('drag', { event: e.event, element: this.element, target: e.target });
4244
4270
  let newInst = this.getSortableInstance(e.target);
4245
4271
  let target = this.getSortableElement(e.target, newInst);
4246
4272
  if ((this.isValidTarget(target, newInst) || e.target.className.indexOf('e-list-group-item') > -1) && (this.curTarget !== target ||
4247
- !isNullOrUndefined(newInst.placeHolder)) && (newInst.placeHolderElement ? newInst.placeHolderElement !== e.target :
4248
- true)) {
4273
+ !isNullOrUndefined(newInst.placeHolder)) && (newInst.placeHolderElement ? newInst.placeHolderElement !== e.target : true)) {
4249
4274
  if (e.target.className.indexOf('e-list-group-item') > -1) {
4250
4275
  target = e.target;
4251
4276
  }
@@ -4399,7 +4424,7 @@ let Sortable = Sortable_1 = class Sortable extends Base {
4399
4424
  this.target = null;
4400
4425
  this.curTarget = null;
4401
4426
  remove(e.helper);
4402
- getComponent(this.element, Draggable).intDestroy(e.event);
4427
+ getComponent(this.element, 'draggable').intDestroy(e.event);
4403
4428
  };
4404
4429
  this.bind();
4405
4430
  }