@syncfusion/ej2-lists 19.2.49 → 19.3.44

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.
Files changed (42) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/dist/ej2-lists.umd.min.js +2 -2
  4. package/dist/ej2-lists.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-lists.es2015.js +243 -685
  6. package/dist/es6/ej2-lists.es2015.js.map +1 -1
  7. package/dist/es6/ej2-lists.es5.js +243 -688
  8. package/dist/es6/ej2-lists.es5.js.map +1 -1
  9. package/dist/global/ej2-lists.min.js +2 -2
  10. package/dist/global/ej2-lists.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +8 -8
  13. package/src/common/list-base.d.ts +1 -16
  14. package/src/common/list-base.js +19 -12
  15. package/src/list-view/list-view-model.d.ts +1 -6
  16. package/src/list-view/list-view.d.ts +3 -19
  17. package/src/list-view/list-view.js +163 -460
  18. package/src/list-view/virtualization.js +56 -204
  19. package/src/sortable/sortable-model.d.ts +1 -1
  20. package/src/sortable/sortable.js +3 -9
  21. package/styles/bootstrap5-dark.css +533 -0
  22. package/styles/bootstrap5-dark.scss +2 -0
  23. package/styles/bootstrap5.css +533 -0
  24. package/styles/bootstrap5.scss +2 -0
  25. package/styles/list-view/_bootstrap5-dark-definition.scss +1 -0
  26. package/styles/list-view/_bootstrap5-definition.scss +129 -0
  27. package/styles/list-view/_layout.scss +26 -26
  28. package/styles/list-view/_tailwind-dark-definition.scss +1 -116
  29. package/styles/list-view/_tailwind-definition.scss +33 -29
  30. package/styles/list-view/_theme.scss +35 -10
  31. package/styles/list-view/bootstrap5-dark.css +506 -0
  32. package/styles/list-view/bootstrap5-dark.scss +5 -0
  33. package/styles/list-view/bootstrap5.css +506 -0
  34. package/styles/list-view/bootstrap5.scss +5 -0
  35. package/styles/list-view/icons/_bootstrap5-dark.scss +1 -0
  36. package/styles/list-view/icons/_bootstrap5.scss +8 -0
  37. package/styles/list-view/material-dark.css +1 -1
  38. package/styles/material-dark.css +1 -1
  39. package/styles/sortable/bootstrap5-dark.css +26 -0
  40. package/styles/sortable/bootstrap5-dark.scss +2 -0
  41. package/styles/sortable/bootstrap5.css +26 -0
  42. package/styles/sortable/bootstrap5.scss +2 -0
@@ -17,7 +17,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
17
17
  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;
18
18
  return c > 3 && r && Object.defineProperty(target, key, r), r;
19
19
  };
20
- import { merge, formatUnit, isNullOrUndefined, append, detach, isBlazor, extend } from '@syncfusion/ej2-base';
20
+ import { merge, formatUnit, isNullOrUndefined, append, detach, extend } from '@syncfusion/ej2-base';
21
21
  import { attributes, addClass, removeClass, prepend, closest, remove } from '@syncfusion/ej2-base';
22
22
  import { Component, EventHandler, Property, Complex, Event } from '@syncfusion/ej2-base';
23
23
  import { NotifyPropertyChanges, ChildProperty } from '@syncfusion/ej2-base';
@@ -26,7 +26,6 @@ import { Animation, rippleEffect, Touch } from '@syncfusion/ej2-base';
26
26
  import { DataManager, Query } from '@syncfusion/ej2-data';
27
27
  import { createCheckBox } from '@syncfusion/ej2-buttons';
28
28
  import { ListBase, getFieldValues } from '../common/list-base';
29
- import { updateBlazorTemplate, resetBlazorTemplate, blazorTemplates } from '@syncfusion/ej2-base';
30
29
  // Effect Configuration Effect[] = [fromViewBackward,fromViewForward,toViewBackward,toviewForward];
31
30
  var effectsConfig = {
32
31
  'None': [],
@@ -153,7 +152,6 @@ var ListView = /** @class */ (function (_super) {
153
152
  */
154
153
  function ListView(options, element) {
155
154
  var _this = _super.call(this, options, element) || this;
156
- _this.itemReRender = false;
157
155
  _this.previousSelectedItems = [];
158
156
  _this.hiddenItems = [];
159
157
  _this.enabledItems = [];
@@ -191,14 +189,9 @@ var ListView = /** @class */ (function (_super) {
191
189
  // eslint-disable-next-line
192
190
  this.listBaseOption.fields = this.fields.properties;
193
191
  if (this.enableVirtualization) {
194
- if (!(this.isServerRendered && isBlazor())) {
195
- this.virtualizationModule.reRenderUiVirtualization();
196
- }
192
+ this.virtualizationModule.reRenderUiVirtualization();
197
193
  }
198
194
  else {
199
- if (isBlazor() && this.isServerRendered && !this.enableVirtualization) {
200
- this.itemReRender = true;
201
- }
202
195
  this.reRender();
203
196
  }
204
197
  break;
@@ -209,14 +202,9 @@ var ListView = /** @class */ (function (_super) {
209
202
  break;
210
203
  case 'query':
211
204
  if (this.enableVirtualization) {
212
- if (!(isBlazor() && this.isServerRendered)) {
213
- this.virtualizationModule.reRenderUiVirtualization();
214
- }
205
+ this.virtualizationModule.reRenderUiVirtualization();
215
206
  }
216
207
  else {
217
- if (isBlazor() && this.isServerRendered && !this.enableVirtualization) {
218
- this.itemReRender = true;
219
- }
220
208
  this.reRender();
221
209
  }
222
210
  break;
@@ -231,50 +219,35 @@ var ListView = /** @class */ (function (_super) {
231
219
  break;
232
220
  case 'showCheckBox':
233
221
  case 'checkBoxPosition':
234
- if (!isBlazor() || !this.isServerRendered) {
235
- if (this.enableVirtualization) {
236
- this.virtualizationModule.reRenderUiVirtualization();
237
- }
238
- else {
239
- this.setCheckbox();
240
- }
222
+ if (this.enableVirtualization) {
223
+ this.virtualizationModule.reRenderUiVirtualization();
224
+ }
225
+ else {
226
+ this.setCheckbox();
241
227
  }
242
228
  break;
243
229
  case 'dataSource':
244
230
  if (this.enableVirtualization) {
245
- if (!(this.isServerRendered && isBlazor())) {
246
- this.virtualizationModule.reRenderUiVirtualization();
247
- }
231
+ this.virtualizationModule.reRenderUiVirtualization();
248
232
  }
249
233
  else {
250
- if (isBlazor() && this.isServerRendered && !this.enableVirtualization) {
251
- this.itemReRender = true;
252
- }
253
234
  this.reRender();
254
235
  }
255
236
  break;
256
237
  case 'sortOrder':
257
238
  case 'template':
258
239
  if (!this.enableVirtualization) {
259
- if (!(this.isServerRendered && isBlazor())) {
260
- this.refresh();
261
- }
240
+ this.refresh();
262
241
  }
263
242
  break;
264
243
  case 'showIcon':
265
- if (isBlazor() && this.isServerRendered) {
266
- // eslint-disable-next-line
267
- this.interopAdaptor.invokeMethodAsync('ItemSorting');
244
+ if (this.enableVirtualization) {
245
+ this.virtualizationModule.reRenderUiVirtualization();
268
246
  }
269
247
  else {
270
- if (this.enableVirtualization) {
271
- this.virtualizationModule.reRenderUiVirtualization();
272
- }
273
- else {
274
- this.listBaseOption.showIcon = this.showIcon;
275
- this.curViewDS = this.getSubDS();
276
- this.resetCurrentList();
277
- }
248
+ this.listBaseOption.showIcon = this.showIcon;
249
+ this.curViewDS = this.getSubDS();
250
+ this.resetCurrentList();
278
251
  }
279
252
  break;
280
253
  default:
@@ -322,76 +295,68 @@ var ListView = /** @class */ (function (_super) {
322
295
  };
323
296
  // Support Component Functions
324
297
  ListView.prototype.header = function (text, showBack, prop) {
325
- if (isBlazor() && this.isServerRendered) {
326
- var args = { HeaderText: text, BackButton: showBack };
327
- // eslint-disable-next-line
328
- this.interopAdaptor.invokeMethodAsync('HeaderTitle', args);
298
+ if (this.headerEle === undefined && this.showHeader) {
299
+ if (this.enableHtmlSanitizer) {
300
+ this.setProperties({ headerTitle: SanitizeHtmlHelper.sanitize(this.headerTitle) }, true);
301
+ }
302
+ this.headerEle = this.createElement('div', { className: classNames.header });
303
+ var innerHeaderEle = this.createElement('span', { className: classNames.headerText, innerHTML: this.headerTitle });
304
+ var textEle = this.createElement('div', { className: classNames.text, innerHTML: innerHeaderEle.outerHTML });
305
+ var hedBackButton = this.createElement('div', {
306
+ className: classNames.icon + ' ' + classNames.backIcon + ' e-but-back',
307
+ attrs: { style: 'display:none;' }
308
+ });
309
+ this.headerEle.appendChild(hedBackButton);
310
+ this.headerEle.appendChild(textEle);
311
+ if (this.headerTemplate) {
312
+ // eslint-disable-next-line
313
+ var compiledString = compile(this.headerTemplate);
314
+ var headerTemplateEle = this.createElement('div', { className: classNames.headerTemplateText });
315
+ // eslint-disable-next-line
316
+ var compiledElement = compiledString({}, this, prop, this.LISTVIEW_HEADERTEMPLATE_ID, null, null, this.headerEle);
317
+ if (compiledElement) {
318
+ append(compiledElement, headerTemplateEle);
319
+ }
320
+ append([headerTemplateEle], this.headerEle);
321
+ // eslint-disable-next-line
322
+ if (this.isReact) {
323
+ this.renderReactTemplates();
324
+ }
325
+ }
326
+ if (this.headerTemplate && this.headerTitle) {
327
+ textEle.classList.add('header');
328
+ }
329
+ this.element.classList.add('e-has-header');
330
+ prepend([this.headerEle], this.element);
329
331
  }
330
- else {
331
- if (this.headerEle === undefined && this.showHeader) {
332
+ else if (this.headerEle) {
333
+ if (this.showHeader) {
334
+ this.headerEle.style.display = '';
335
+ var textEle = this.headerEle.querySelector('.' + classNames.headerText);
336
+ var hedBackButton = this.headerEle.querySelector('.' + classNames.backIcon);
332
337
  if (this.enableHtmlSanitizer) {
333
- this.setProperties({ headerTitle: SanitizeHtmlHelper.sanitize(this.headerTitle) }, true);
338
+ text = SanitizeHtmlHelper.sanitize(text);
334
339
  }
335
- this.headerEle = this.createElement('div', { className: classNames.header });
336
- var innerHeaderEle = this.createElement('span', { className: classNames.headerText, innerHTML: this.headerTitle });
337
- var textEle = this.createElement('div', { className: classNames.text, innerHTML: innerHeaderEle.outerHTML });
338
- var hedBackButton = this.createElement('div', {
339
- className: classNames.icon + ' ' + classNames.backIcon + ' e-but-back',
340
- attrs: { style: 'display:none;' }
341
- });
342
- this.headerEle.appendChild(hedBackButton);
343
- this.headerEle.appendChild(textEle);
344
- if (this.headerTemplate) {
345
- // eslint-disable-next-line
346
- var compiledString = compile(this.headerTemplate);
347
- var headerTemplateEle = this.createElement('div', { className: classNames.headerTemplateText });
348
- // eslint-disable-next-line
349
- var compiledElement = compiledString({}, this, prop, this.LISTVIEW_HEADERTEMPLATE_ID, null, null, this.headerEle);
350
- if (compiledElement) {
351
- append(compiledElement, headerTemplateEle);
352
- }
353
- append([headerTemplateEle], this.headerEle);
354
- this.updateBlazorTemplates(false, true, true);
355
- // eslint-disable-next-line
356
- if (this.isReact) {
357
- this.renderReactTemplates();
358
- }
340
+ textEle.innerHTML = text;
341
+ if (this.headerTemplate && showBack) {
342
+ textEle.parentElement.classList.remove('header');
343
+ this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.add('nested-header');
359
344
  }
360
- if (this.headerTemplate && this.headerTitle) {
361
- textEle.classList.add('header');
345
+ if (this.headerTemplate && !showBack) {
346
+ textEle.parentElement.classList.add('header');
347
+ this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.remove('nested-header');
348
+ this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.add('header');
362
349
  }
363
- this.element.classList.add('e-has-header');
364
- prepend([this.headerEle], this.element);
365
- }
366
- else if (this.headerEle) {
367
- if (this.showHeader) {
368
- this.headerEle.style.display = '';
369
- var textEle = this.headerEle.querySelector('.' + classNames.headerText);
370
- var hedBackButton = this.headerEle.querySelector('.' + classNames.backIcon);
371
- if (this.enableHtmlSanitizer) {
372
- text = SanitizeHtmlHelper.sanitize(text);
373
- }
374
- textEle.innerHTML = text;
375
- if (this.headerTemplate && showBack) {
376
- textEle.parentElement.classList.remove('header');
377
- this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.add('nested-header');
378
- }
379
- if (this.headerTemplate && !showBack) {
380
- textEle.parentElement.classList.add('header');
381
- this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.remove('nested-header');
382
- this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.add('header');
383
- }
384
- if (showBack === true) {
385
- hedBackButton.style.display = '';
386
- }
387
- else {
388
- hedBackButton.style.display = 'none';
389
- }
350
+ if (showBack === true) {
351
+ hedBackButton.style.display = '';
390
352
  }
391
353
  else {
392
- this.headerEle.style.display = 'none';
354
+ hedBackButton.style.display = 'none';
393
355
  }
394
356
  }
357
+ else {
358
+ this.headerEle.style.display = 'none';
359
+ }
395
360
  }
396
361
  };
397
362
  // Animation Related Functions
@@ -442,7 +407,7 @@ var ListView = /** @class */ (function (_super) {
442
407
  if (this.template) {
443
408
  try {
444
409
  if (document.querySelectorAll(this.template).length) {
445
- this.template = document.querySelector(this.template).innerHTML.trim();
410
+ this.setProperties({ template: document.querySelector(this.template).innerHTML.trim() }, true);
446
411
  }
447
412
  }
448
413
  catch (e) {
@@ -465,39 +430,10 @@ var ListView = /** @class */ (function (_super) {
465
430
  templateID: "" + this.element.id + LISTVIEW_TEMPLATE_PROPERTY,
466
431
  groupTemplateID: "" + this.element.id + LISTVIEW_GROUPTEMPLATE_PROPERTY,
467
432
  enableHtmlSanitizer: this.enableHtmlSanitizer,
468
- removeBlazorID: true
469
433
  };
470
434
  this.initialization();
471
435
  };
472
- ListView.prototype.updateLiElementHeight = function () {
473
- var liContainer = this.element.querySelector('.' + classNames.virtualElementContainer);
474
- if (liContainer.children[0]) {
475
- this.liElementHeight = liContainer.children[0].getBoundingClientRect().height;
476
- // eslint-disable-next-line
477
- this.interopAdaptor.invokeMethodAsync('LiElementHeight', this.liElementHeight);
478
- }
479
- };
480
436
  ListView.prototype.initialization = function () {
481
- if (isBlazor() && this.isServerRendered && this.enableVirtualization) {
482
- var ulContainer = this.element.querySelector('.' + classNames.virtualElementContainer);
483
- if (ulContainer !== null) {
484
- if (this.height === '') {
485
- // eslint-disable-next-line
486
- this.interopAdaptor.invokeMethodAsync('SetComponentHeight', window.innerHeight);
487
- this.isWindow = true;
488
- ulContainer.scrollIntoView();
489
- }
490
- if (this.height.toString().indexOf('%') !== -1) {
491
- // eslint-disable-next-line
492
- this.interopAdaptor.invokeMethodAsync('SetContainerHeight', this.element.getBoundingClientRect().height.toString());
493
- }
494
- if (ulContainer.children[0]) {
495
- this.liElementHeight = ulContainer.children[0].getBoundingClientRect().height;
496
- // eslint-disable-next-line
497
- this.interopAdaptor.invokeMethodAsync('LiElementHeight', this.liElementHeight);
498
- }
499
- }
500
- }
501
437
  this.curDSLevel = [];
502
438
  this.animateOptions = {};
503
439
  this.curViewDS = [];
@@ -747,38 +683,6 @@ var ListView = /** @class */ (function (_super) {
747
683
  }
748
684
  }
749
685
  }
750
- if (isBlazor() && this.isServerRendered && this.enableVirtualization) {
751
- var ulElementContainer = this.element.querySelector('.' + classNames.virtualElementContainer);
752
- if (ulElementContainer.querySelector('.e-active')) {
753
- // eslint-disable-next-line
754
- var selectedElements = ulElementContainer.querySelectorAll('.e-active');
755
- if (this.showCheckBox) {
756
- for (var i = 0; i < selectedElements.length; i++) {
757
- // eslint-disable-next-line
758
- if (!this.previousSelectedItems.includes(selectedElements[i].getAttribute('data-uid'))) {
759
- this.previousSelectedItems.push(selectedElements[i].getAttribute('data-uid'));
760
- }
761
- }
762
- }
763
- else {
764
- this.previousSelectedItems[0] = (ulElementContainer.querySelector('.e-active').getAttribute('data-uid'));
765
- }
766
- }
767
- if (ulElementContainer.querySelector('.e-focused')) {
768
- // eslint-disable-next-line
769
- var focusElement = ulElementContainer.querySelector('.e-focused');
770
- if (!focusElement.classList.contains('e-active')) {
771
- var focusElementId = focusElement.getAttribute('data-uid');
772
- // eslint-disable-next-line
773
- if (this.previousSelectedItems.includes(focusElementId)) {
774
- var selectedElement1 = this.previousSelectedItems.slice(0, this.previousSelectedItems.indexOf(focusElementId));
775
- var selectedElement2 = this.previousSelectedItems.
776
- slice(this.previousSelectedItems.indexOf(focusElementId) + 1, this.previousSelectedItems.length);
777
- this.previousSelectedItems = selectedElement1.concat(selectedElement2);
778
- }
779
- }
780
- }
781
- }
782
686
  };
783
687
  ListView.prototype.removeElement = function (element) {
784
688
  return element && element.parentNode && element.parentNode.removeChild(element);
@@ -1271,14 +1175,14 @@ var ListView = /** @class */ (function (_super) {
1271
1175
  if (dataSource === void 0) { dataSource = this.localData; }
1272
1176
  if (dataSource && this.fields.groupBy) {
1273
1177
  if (this.sortOrder !== 'None') {
1274
- this.curViewDS = ListBase.groupDataSource(ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, this.fields.sortBy)), this.listBaseOption.fields, this.sortOrder);
1178
+ this.curViewDS = ListBase.groupDataSource(ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, (isNullOrUndefined(this.fields.sortBy)) ? this.fields.text : this.fields.sortBy)), this.listBaseOption.fields, this.sortOrder);
1275
1179
  }
1276
1180
  else {
1277
1181
  this.curViewDS = ListBase.groupDataSource(dataSource, this.listBaseOption.fields, this.sortOrder);
1278
1182
  }
1279
1183
  }
1280
1184
  else if (dataSource && this.sortOrder !== 'None') {
1281
- this.curViewDS = ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, this.fields.sortBy));
1185
+ this.curViewDS = ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, (isNullOrUndefined(this.fields.sortBy)) ? this.fields.text : this.fields.sortBy));
1282
1186
  }
1283
1187
  else {
1284
1188
  this.curViewDS = dataSource;
@@ -1287,28 +1191,45 @@ var ListView = /** @class */ (function (_super) {
1287
1191
  ListView.prototype.isInAnimation = function () {
1288
1192
  return this.curUL.classList.contains('.e-animate');
1289
1193
  };
1194
+ ListView.prototype.renderRemoteLists = function (e, listViewComponent) {
1195
+ if (this.isDestroyed) {
1196
+ return;
1197
+ }
1198
+ this.localData = e.result;
1199
+ listViewComponent.removeElement(listViewComponent.contentContainer);
1200
+ this.renderList();
1201
+ this.trigger('actionComplete', e);
1202
+ };
1203
+ ListView.prototype.triggerActionFailure = function (e) {
1204
+ if (this.isDestroyed) {
1205
+ return;
1206
+ }
1207
+ this.trigger('actionFailure', e);
1208
+ };
1290
1209
  ListView.prototype.setLocalData = function () {
1291
1210
  var _this = this;
1292
1211
  this.trigger('actionBegin');
1293
1212
  // eslint-disable-next-line
1294
1213
  var listViewComponent = this;
1295
1214
  if (this.dataSource instanceof DataManager) {
1296
- this.dataSource.executeQuery(this.getQuery()).then(function (e) {
1297
- if (_this.isDestroyed) {
1298
- return;
1299
- }
1300
- _this.localData = e.result;
1301
- if (!_this.isServerRendered || (!isBlazor())) {
1302
- listViewComponent.removeElement(listViewComponent.contentContainer);
1303
- }
1304
- _this.renderList();
1305
- _this.trigger('actionComplete', e);
1306
- }).catch(function (e) {
1307
- if (_this.isDestroyed) {
1308
- return;
1309
- }
1310
- _this.trigger('actionFailure', e);
1311
- });
1215
+ if (this.dataSource.ready) {
1216
+ this.dataSource.ready.then(function (e) {
1217
+ /* eslint-disable */
1218
+ _this.isOffline = _this.dataSource.dataSource.offline;
1219
+ if (_this.dataSource instanceof DataManager && _this.isOffline) {
1220
+ _this.renderRemoteLists(e, listViewComponent);
1221
+ }
1222
+ }).catch(function (e) {
1223
+ _this.triggerActionFailure(e);
1224
+ });
1225
+ }
1226
+ else {
1227
+ this.dataSource.executeQuery(this.getQuery()).then(function (e) {
1228
+ _this.renderRemoteLists(e, listViewComponent);
1229
+ }).catch(function (e) {
1230
+ _this.triggerActionFailure(e);
1231
+ });
1232
+ }
1312
1233
  }
1313
1234
  else if (!this.dataSource || !this.dataSource.length) {
1314
1235
  var ul = this.element.querySelector('ul');
@@ -1327,25 +1248,21 @@ var ListView = /** @class */ (function (_super) {
1327
1248
  }
1328
1249
  };
1329
1250
  ListView.prototype.reRender = function () {
1330
- if (!isBlazor() || !this.isServerRendered || this.enableVirtualization) {
1331
- this.resetBlazorTemplates();
1332
- this.removeElement(this.headerEle);
1333
- this.removeElement(this.ulElement);
1334
- this.removeElement(this.contentContainer);
1335
- // eslint-disable-next-line
1336
- if (this.isReact) {
1337
- this.clearTemplate();
1338
- }
1339
- if (Object.keys(window).indexOf('ejsInterop') === -1) {
1340
- this.element.innerHTML = '';
1341
- }
1342
- this.headerEle = this.ulElement = this.liCollection = undefined;
1343
- this.header();
1251
+ this.removeElement(this.headerEle);
1252
+ this.removeElement(this.ulElement);
1253
+ this.removeElement(this.contentContainer);
1254
+ // eslint-disable-next-line
1255
+ if (this.isReact) {
1256
+ this.clearTemplate();
1257
+ }
1258
+ if (Object.keys(window).indexOf('ejsInterop') === -1) {
1259
+ this.element.innerHTML = '';
1344
1260
  }
1261
+ this.headerEle = this.ulElement = this.liCollection = undefined;
1262
+ this.header();
1345
1263
  this.setLocalData();
1346
1264
  };
1347
1265
  ListView.prototype.resetCurrentList = function () {
1348
- this.resetBlazorTemplates();
1349
1266
  this.setViewDataSource(this.curViewDS);
1350
1267
  this.contentContainer.innerHTML = '';
1351
1268
  this.createList();
@@ -1367,36 +1284,6 @@ var ListView = /** @class */ (function (_super) {
1367
1284
  this.ulElement = this.curUL = ListBase.createList(this.createElement, this.curViewDS, this.listBaseOption, null, this);
1368
1285
  this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
1369
1286
  this.setAttributes(this.liCollection);
1370
- this.updateBlazorTemplates(true);
1371
- };
1372
- ListView.prototype.resetBlazorTemplates = function () {
1373
- // eslint-disable-next-line
1374
- var templateCollection = blazorTemplates;
1375
- if (this.template) {
1376
- templateCollection[this.LISTVIEW_TEMPLATE_ID] = [];
1377
- resetBlazorTemplate(this.LISTVIEW_TEMPLATE_ID, LISTVIEW_TEMPLATE_PROPERTY);
1378
- }
1379
- if (this.groupTemplate) {
1380
- templateCollection[this.LISTVIEW_GROUPTEMPLATE_ID] = [];
1381
- resetBlazorTemplate(this.LISTVIEW_GROUPTEMPLATE_ID, LISTVIEW_GROUPTEMPLATE_PROPERTY);
1382
- }
1383
- if (this.headerTemplate) {
1384
- resetBlazorTemplate(this.LISTVIEW_HEADERTEMPLATE_ID, LISTVIEW_HEADERTEMPLATE_PROPERTY);
1385
- }
1386
- };
1387
- ListView.prototype.updateBlazorTemplates = function (template, headerTemplate, resetExistingElements) {
1388
- if (template === void 0) { template = false; }
1389
- if (headerTemplate === void 0) { headerTemplate = false; }
1390
- if (resetExistingElements === void 0) { resetExistingElements = false; }
1391
- if (this.template && template && !this.enableVirtualization) {
1392
- updateBlazorTemplate(this.LISTVIEW_TEMPLATE_ID, LISTVIEW_TEMPLATE_PROPERTY, this, resetExistingElements);
1393
- }
1394
- if (this.groupTemplate && template && !this.enableVirtualization) {
1395
- updateBlazorTemplate(this.LISTVIEW_GROUPTEMPLATE_ID, LISTVIEW_GROUPTEMPLATE_PROPERTY, this, resetExistingElements);
1396
- }
1397
- if (this.headerTemplate && headerTemplate) {
1398
- updateBlazorTemplate(this.LISTVIEW_HEADERTEMPLATE_ID, LISTVIEW_HEADERTEMPLATE_PROPERTY, this, resetExistingElements);
1399
- }
1400
1287
  };
1401
1288
  ListView.prototype.exceptionEvent = function (e) {
1402
1289
  this.trigger('actionFailure', e);
@@ -1408,97 +1295,6 @@ var ListView = /** @class */ (function (_super) {
1408
1295
  this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
1409
1296
  }
1410
1297
  };
1411
- ListView.prototype.removeActiveClass = function () {
1412
- // eslint-disable-next-line
1413
- var listViewComponent = this;
1414
- setTimeout(function () {
1415
- var ulContainer = listViewComponent.element.querySelector('.' + classNames.virtualElementContainer);
1416
- for (var i = 0; i < ulContainer.childElementCount; i++) {
1417
- var selectedElement = ulContainer.children[i];
1418
- var elementIndex = void 0;
1419
- var hiddenElementIndex = void 0;
1420
- if (listViewComponent.showCheckBox) {
1421
- if (listViewComponent.previousSelectedItems.length > 0) {
1422
- for (var j = 0; j < listViewComponent.previousSelectedItems.length; j++) {
1423
- if (selectedElement.getAttribute('data-uid') === listViewComponent.previousSelectedItems[j]) {
1424
- selectedElement.classList.add('e-active');
1425
- selectedElement.setAttribute('aria-selected', 'true');
1426
- if (selectedElement.querySelector('.e-frame.e-icons')) {
1427
- selectedElement.querySelector('.e-frame.e-icons').classList.add('e-check');
1428
- }
1429
- elementIndex = i;
1430
- }
1431
- else {
1432
- if (elementIndex !== i) {
1433
- selectedElement.classList.remove('e-active');
1434
- selectedElement.removeAttribute('aria-selected');
1435
- if (selectedElement.querySelector('.e-check')) {
1436
- selectedElement.querySelector('.e-check').classList.remove('e-check');
1437
- }
1438
- }
1439
- }
1440
- }
1441
- }
1442
- else {
1443
- selectedElement.classList.remove('e-active');
1444
- selectedElement.removeAttribute('aria-selected');
1445
- if (selectedElement.querySelector('.e-check')) {
1446
- selectedElement.querySelector('.e-check').classList.remove('e-check');
1447
- }
1448
- }
1449
- }
1450
- else {
1451
- if (selectedElement.getAttribute('data-uid') === listViewComponent.previousSelectedItems[0]) {
1452
- selectedElement.classList.add('e-active');
1453
- selectedElement.setAttribute('aria-selected', 'true');
1454
- }
1455
- else {
1456
- selectedElement.classList.remove('e-active');
1457
- selectedElement.removeAttribute('aria-selected');
1458
- }
1459
- }
1460
- if (listViewComponent.hiddenItems.length > 0) {
1461
- for (var k = 0; k < listViewComponent.hiddenItems.length; k++) {
1462
- if (selectedElement.getAttribute('data-uid') === listViewComponent.previousSelectedItems[k]) {
1463
- selectedElement.style.display = 'none';
1464
- hiddenElementIndex = i;
1465
- }
1466
- else {
1467
- if (hiddenElementIndex !== i) {
1468
- selectedElement.style.display = null;
1469
- }
1470
- }
1471
- }
1472
- }
1473
- if (listViewComponent.enabledItems.length > 0) {
1474
- for (var x = 0; x < listViewComponent.enabledItems.length; x++) {
1475
- if (selectedElement.getAttribute('data-uid') === listViewComponent.enabledItems[x]) {
1476
- if (selectedElement.classList.contains('e-disabled')) {
1477
- selectedElement.classList.remove('e-disabled');
1478
- }
1479
- }
1480
- }
1481
- }
1482
- if (listViewComponent.disabledItems.length > 0) {
1483
- for (var y = 0; y < listViewComponent.disabledItems.length; y++) {
1484
- if (selectedElement.getAttribute('data-uid') === listViewComponent.disabledItems[y]) {
1485
- if (!selectedElement.classList.contains('e-disabled')) {
1486
- selectedElement.classList.add('e-disabled');
1487
- }
1488
- }
1489
- }
1490
- }
1491
- }
1492
- }, 200);
1493
- };
1494
- ListView.prototype.renderingNestedList = function () {
1495
- var ul = closest(this.liElement.parentNode, '.' + classNames.parentItem);
1496
- var ctrlId = this.element.id;
1497
- var ulElement = document.getElementById(ctrlId);
1498
- var currentListItem = ulElement.getElementsByTagName('UL')[ulElement.getElementsByTagName('UL').length - 1];
1499
- this.switchView(ul, currentListItem);
1500
- this.liElement = null;
1501
- };
1502
1298
  ListView.prototype.renderSubList = function (li) {
1503
1299
  this.liElement = li;
1504
1300
  var uID = li.getAttribute('data-uid');
@@ -1509,27 +1305,18 @@ var ListView = /** @class */ (function (_super) {
1509
1305
  this.setViewDataSource(this.getSubDS());
1510
1306
  if (!ele) {
1511
1307
  var data = this.curViewDS;
1512
- if (isBlazor() && this.isServerRendered) {
1513
- // eslint-disable-next-line
1514
- this.interopAdaptor.invokeMethodAsync('ListChildDataSource', data);
1515
- }
1516
- else {
1517
- ele = ListBase.createListFromJson(this.createElement, data, this.listBaseOption, this.curDSLevel.length, null, this);
1518
- // eslint-disable-next-line
1519
- if (this.isReact) {
1520
- this.renderReactTemplates();
1521
- }
1522
- var lists = ele.querySelectorAll('.' + classNames.listItem);
1523
- this.setAttributes(lists);
1524
- ele.setAttribute('pID', uID);
1525
- ele.style.display = 'none';
1526
- this.renderIntoDom(ele);
1527
- this.updateBlazorTemplates(true);
1308
+ ele = ListBase.createListFromJson(this.createElement, data, this.listBaseOption, this.curDSLevel.length, null, this);
1309
+ // eslint-disable-next-line
1310
+ if (this.isReact) {
1311
+ this.renderReactTemplates();
1528
1312
  }
1313
+ var lists = ele.querySelectorAll('.' + classNames.listItem);
1314
+ this.setAttributes(lists);
1315
+ ele.setAttribute('pID', uID);
1316
+ ele.style.display = 'none';
1317
+ this.renderIntoDom(ele);
1529
1318
  }
1530
- if (!isBlazor() || !this.isServerRendered || this.enableVirtualization) {
1531
- this.switchView(ul, ele);
1532
- }
1319
+ this.switchView(ul, ele);
1533
1320
  this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
1534
1321
  if (this.selectedItems) {
1535
1322
  var fieldData = getFieldValues(this.selectedItems.data, this.listBaseOption.fields);
@@ -1544,38 +1331,34 @@ var ListView = /** @class */ (function (_super) {
1544
1331
  };
1545
1332
  ListView.prototype.renderList = function (data) {
1546
1333
  this.setViewDataSource(data);
1547
- if (!isBlazor() || !this.isServerRendered || this.enableVirtualization) {
1548
- if (this.enableVirtualization) {
1549
- if (Object.keys(this.dataSource).length) {
1550
- if (!(isBlazor() && this.isServerRendered)) {
1551
- if ((this.template || this.groupTemplate) && !this.virtualizationModule.isNgTemplate()) {
1552
- if (this.isReact) {
1553
- if (typeof this.template == "string") {
1554
- this.listBaseOption.template = null;
1555
- }
1556
- if (typeof this.groupTemplate == "string") {
1557
- this.listBaseOption.groupTemplate = null;
1558
- }
1559
- }
1560
- else {
1561
- this.listBaseOption.template = null;
1562
- this.listBaseOption.groupTemplate = null;
1563
- }
1564
- this.listBaseOption.itemCreated = this.virtualizationModule.createUIItem.bind(this.virtualizationModule);
1334
+ if (this.enableVirtualization) {
1335
+ if (Object.keys(this.dataSource).length) {
1336
+ if ((this.template || this.groupTemplate) && !this.virtualizationModule.isNgTemplate()) {
1337
+ if (this.isReact) {
1338
+ if (typeof this.template == "string") {
1339
+ this.listBaseOption.template = null;
1340
+ }
1341
+ if (typeof this.groupTemplate == "string") {
1342
+ this.listBaseOption.groupTemplate = null;
1565
1343
  }
1566
1344
  }
1345
+ else {
1346
+ this.listBaseOption.template = null;
1347
+ this.listBaseOption.groupTemplate = null;
1348
+ }
1349
+ this.listBaseOption.itemCreated = this.virtualizationModule.createUIItem.bind(this.virtualizationModule);
1567
1350
  }
1568
- this.virtualizationModule.uiVirtualization();
1569
1351
  }
1570
- else {
1571
- this.createList();
1572
- this.contentContainer = this.createElement('div', { className: classNames.content });
1573
- this.element.appendChild(this.contentContainer);
1574
- this.renderIntoDom(this.ulElement);
1575
- // eslint-disable-next-line
1576
- if (this.isReact) {
1577
- this.renderReactTemplates();
1578
- }
1352
+ this.virtualizationModule.uiVirtualization();
1353
+ }
1354
+ else {
1355
+ this.createList();
1356
+ this.contentContainer = this.createElement('div', { className: classNames.content });
1357
+ this.element.appendChild(this.contentContainer);
1358
+ this.renderIntoDom(this.ulElement);
1359
+ // eslint-disable-next-line
1360
+ if (this.isReact) {
1361
+ this.renderReactTemplates();
1579
1362
  }
1580
1363
  }
1581
1364
  };
@@ -1594,42 +1377,25 @@ var ListView = /** @class */ (function (_super) {
1594
1377
  * Initializes the ListView component rendering.
1595
1378
  */
1596
1379
  ListView.prototype.render = function () {
1597
- if (!isBlazor() || !this.isServerRendered) {
1598
- this.element.classList.add(classNames.root);
1599
- attributes(this.element, { role: 'list', tabindex: '0' });
1600
- this.setCSSClass();
1601
- this.setEnableRTL();
1602
- this.setEnable();
1603
- this.setSize();
1604
- this.wireEvents();
1605
- this.header();
1606
- this.setLocalData();
1607
- this.setHTMLAttribute();
1608
- }
1609
- else {
1610
- this.initBlazor(true);
1611
- }
1380
+ this.element.classList.add(classNames.root);
1381
+ attributes(this.element, { role: 'list', tabindex: '0' });
1382
+ this.setCSSClass();
1383
+ this.setEnableRTL();
1384
+ this.setEnable();
1385
+ this.setSize();
1386
+ this.wireEvents();
1387
+ this.header();
1388
+ this.setLocalData();
1389
+ this.setHTMLAttribute();
1612
1390
  this.rippleFn = rippleEffect(this.element, {
1613
1391
  selector: '.' + classNames.listItem
1614
1392
  });
1615
1393
  this.renderComplete();
1616
1394
  };
1617
- ListView.prototype.initBlazor = function (firstRender) {
1618
- if (firstRender === null) {
1619
- firstRender = false;
1620
- }
1621
- this.setLocalData();
1622
- this.setViewDataSource(this.localData);
1623
- this.contentContainer = this.element.querySelector('.' + classNames.content);
1624
- if (firstRender) {
1625
- this.wireEvents();
1626
- }
1627
- };
1628
1395
  /**
1629
1396
  * It is used to destroy the ListView component.
1630
1397
  */
1631
1398
  ListView.prototype.destroy = function () {
1632
- this.resetBlazorTemplates();
1633
1399
  // eslint-disable-next-line
1634
1400
  if (this.isReact) {
1635
1401
  this.clearTemplate();
@@ -1641,13 +1407,8 @@ var ListView = /** @class */ (function (_super) {
1641
1407
  this.element.removeAttribute('role');
1642
1408
  this.element.removeAttribute('tabindex');
1643
1409
  this.curUL = this.ulElement = this.liCollection = this.headerEle = undefined;
1644
- if (!(isBlazor() && this.isServerRendered)) {
1645
- this.element.innerHTML = '';
1646
- _super.prototype.destroy.call(this);
1647
- }
1648
- else {
1649
- this.element.style.display = 'none';
1650
- }
1410
+ this.element.innerHTML = '';
1411
+ _super.prototype.destroy.call(this);
1651
1412
  };
1652
1413
  /**
1653
1414
  * Switches back from the navigated sub list item.
@@ -1667,12 +1428,7 @@ var ListView = /** @class */ (function (_super) {
1667
1428
  toUL = this.curUL;
1668
1429
  }
1669
1430
  else {
1670
- if (isBlazor() && this.isServerRendered && this.enableVirtualization) {
1671
- toUL = toUL.parentElement.parentElement.parentElement;
1672
- }
1673
- else {
1674
- toUL = toUL.parentElement;
1675
- }
1431
+ toUL = toUL.parentElement;
1676
1432
  }
1677
1433
  var fieldData = getFieldValues(this.curDSJSON, this.listBaseOption.fields);
1678
1434
  // eslint-disable-next-line
@@ -1790,7 +1546,6 @@ var ListView = /** @class */ (function (_super) {
1790
1546
  /**
1791
1547
  * Gets the details of the currently selected item from the list items.
1792
1548
  *
1793
- * @blazorType ListSelectedItem<TValue>
1794
1549
  */
1795
1550
  ListView.prototype.getSelectedItems = function () {
1796
1551
  // eslint-disable-next-line
@@ -1878,55 +1633,12 @@ var ListView = /** @class */ (function (_super) {
1878
1633
  }
1879
1634
  }
1880
1635
  }
1881
- if (isBlazor()) {
1882
- // eslint-disable-next-line
1883
- return this.blazorGetSelectedItems(finalValue);
1884
- }
1885
- else {
1886
- return finalValue;
1887
- }
1888
- };
1889
- // eslint-disable-next-line
1890
- ListView.prototype.blazorGetSelectedItems = function (finalGetSelectedItem) {
1891
- var blazorSelectedItem = {
1892
- data: [],
1893
- index: [],
1894
- parentId: [],
1895
- text: []
1896
- };
1897
- if (!isNullOrUndefined(finalGetSelectedItem)) {
1898
- if (!isNullOrUndefined(finalGetSelectedItem.data)) {
1899
- if (this.showCheckBox && this.isNestedList) {
1900
- for (var i = 0; i < finalGetSelectedItem.data.length; i++) {
1901
- blazorSelectedItem.data.push(finalGetSelectedItem.data[i].data);
1902
- }
1903
- if (!isNullOrUndefined(finalGetSelectedItem.data[0])
1904
- && !isNullOrUndefined(finalGetSelectedItem.data[0].parentId)) {
1905
- blazorSelectedItem.parentId = finalGetSelectedItem.data[0].parentId;
1906
- }
1907
- }
1908
- else {
1909
- blazorSelectedItem.data = this.convertItemsToArray(finalGetSelectedItem.data);
1910
- }
1911
- }
1912
- if (!isNullOrUndefined(finalGetSelectedItem.text)) {
1913
- blazorSelectedItem.text = this.convertItemsToArray(finalGetSelectedItem.text);
1914
- }
1915
- if (!isNullOrUndefined(finalGetSelectedItem.index)) {
1916
- blazorSelectedItem.index = this.convertItemsToArray(finalGetSelectedItem.index);
1917
- }
1918
- }
1919
- return blazorSelectedItem;
1920
- };
1921
- // eslint-disable-next-line
1922
- ListView.prototype.convertItemsToArray = function (items) {
1923
- return Array.isArray(items) ? items.slice() : [items];
1636
+ return finalValue;
1924
1637
  };
1925
1638
  /**
1926
1639
  * Finds out an item details from the current list.
1927
1640
  *
1928
1641
  * @param {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
1929
- * @blazorType TValue
1930
1642
  */
1931
1643
  ListView.prototype.findItem = function (item) {
1932
1644
  return this.getItemData(item);
@@ -2023,7 +1735,6 @@ var ListView = /** @class */ (function (_super) {
2023
1735
  *
2024
1736
  * @param {Fields} fields - Target item to add the given data as its children (can be null).
2025
1737
  *
2026
- * @blazorType data|object,fields|object
2027
1738
  */
2028
1739
  ListView.prototype.addItem = function (data, fields) {
2029
1740
  if (fields === void 0) { fields = undefined; }
@@ -2066,9 +1777,6 @@ var ListView = /** @class */ (function (_super) {
2066
1777
  this.reRender();
2067
1778
  }
2068
1779
  }
2069
- if (this.curUL) {
2070
- this.updateBlazorTemplates(true);
2071
- }
2072
1780
  this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
2073
1781
  }
2074
1782
  else {
@@ -2112,9 +1820,6 @@ var ListView = /** @class */ (function (_super) {
2112
1820
  }
2113
1821
  isRefreshTemplateNeeded = true;
2114
1822
  }
2115
- if (isRefreshTemplateNeeded) {
2116
- this.updateBlazorTemplates(true);
2117
- }
2118
1823
  };
2119
1824
  ListView.prototype.addItemIntoDom = function (currentItem, targetUL, curViewDS) {
2120
1825
  var index = curViewDS.indexOf(currentItem);
@@ -2155,7 +1860,6 @@ var ListView = /** @class */ (function (_super) {
2155
1860
  }
2156
1861
  else {
2157
1862
  this.removeItemFromList(item, listDataSource);
2158
- this.updateBlazorTemplates(true);
2159
1863
  }
2160
1864
  };
2161
1865
  ListView.prototype.removeItemFromList = function (obj, listDataSource) {
@@ -2233,7 +1937,6 @@ var ListView = /** @class */ (function (_super) {
2233
1937
  for (var i = 0; i < item.length; i++) {
2234
1938
  this.removeItem(item[i]);
2235
1939
  }
2236
- this.updateBlazorTemplates(true);
2237
1940
  }
2238
1941
  };
2239
1942
  // eslint-disable-next-line