@syncfusion/ej2-lists 19.2.60 → 19.3.48

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 (39) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +24 -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 +70 -36
  6. package/dist/es6/ej2-lists.es2015.js.map +1 -1
  7. package/dist/es6/ej2-lists.es5.js +70 -36
  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 -0
  14. package/src/common/list-base.js +66 -26
  15. package/src/list-view/list-view.js +2 -2
  16. package/src/sortable/sortable-model.d.ts +1 -1
  17. package/src/sortable/sortable.js +3 -9
  18. package/styles/bootstrap5-dark.css +533 -0
  19. package/styles/bootstrap5-dark.scss +2 -0
  20. package/styles/bootstrap5.css +533 -0
  21. package/styles/bootstrap5.scss +2 -0
  22. package/styles/list-view/_bootstrap5-dark-definition.scss +1 -0
  23. package/styles/list-view/_bootstrap5-definition.scss +129 -0
  24. package/styles/list-view/_layout.scss +26 -26
  25. package/styles/list-view/_tailwind-dark-definition.scss +1 -116
  26. package/styles/list-view/_tailwind-definition.scss +33 -29
  27. package/styles/list-view/_theme.scss +35 -10
  28. package/styles/list-view/bootstrap5-dark.css +506 -0
  29. package/styles/list-view/bootstrap5-dark.scss +5 -0
  30. package/styles/list-view/bootstrap5.css +506 -0
  31. package/styles/list-view/bootstrap5.scss +5 -0
  32. package/styles/list-view/icons/_bootstrap5-dark.scss +1 -0
  33. package/styles/list-view/icons/_bootstrap5.scss +8 -0
  34. package/styles/list-view/material-dark.css +1 -1
  35. package/styles/material-dark.css +1 -1
  36. package/styles/sortable/bootstrap5-dark.css +26 -0
  37. package/styles/sortable/bootstrap5-dark.scss +2 -0
  38. package/styles/sortable/bootstrap5.css +26 -0
  39. package/styles/sortable/bootstrap5.scss +2 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.2.60
3
+ * version : 19.3.48
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-lists@*",
3
- "_id": "@syncfusion/ej2-lists@19.2.49",
3
+ "_id": "@syncfusion/ej2-lists@19.3.45",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-re2uyqgJnkCajWezcKJC2aQErFX29SSmZlVKbgyseJJqT7y+gDonZRTfPWSKijbDSuA+kssEjZs8Ct/SJ0o6DQ==",
5
+ "_integrity": "sha512-GT5gLmp/nT4bKydUCumvFVDylUeQKRO0p9Fv9LPHl6d8qU8+ES1tMOsQ3DRkataMJ2UG5y/i1Uc/QkkuXuB9wg==",
6
6
  "_location": "/@syncfusion/ej2-lists",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -34,8 +34,8 @@
34
34
  "/@syncfusion/ej2-schedule",
35
35
  "/@syncfusion/ej2-vue-lists"
36
36
  ],
37
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-lists/-/ej2-lists-19.2.49.tgz",
38
- "_shasum": "86bb02e372955f1afe1577df0330fd870c8c7ff4",
37
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-lists/-/ej2-lists-19.3.45.tgz",
38
+ "_shasum": "85c528c399c66a61cba765f98b5cb81e204fb983",
39
39
  "_spec": "@syncfusion/ej2-lists@*",
40
40
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
41
41
  "author": {
@@ -43,9 +43,9 @@
43
43
  },
44
44
  "bundleDependencies": false,
45
45
  "dependencies": {
46
- "@syncfusion/ej2-base": "~19.2.60",
47
- "@syncfusion/ej2-buttons": "~19.2.60",
48
- "@syncfusion/ej2-data": "~19.2.60"
46
+ "@syncfusion/ej2-base": "~19.3.47",
47
+ "@syncfusion/ej2-buttons": "~19.3.44",
48
+ "@syncfusion/ej2-data": "~19.3.47"
49
49
  },
50
50
  "deprecated": false,
51
51
  "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.",
@@ -85,6 +85,6 @@
85
85
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/lists"
86
86
  },
87
87
  "typings": "index.d.ts",
88
- "version": "19.2.60",
88
+ "version": "19.3.48",
89
89
  "sideEffects": false
90
90
  }
@@ -260,6 +260,7 @@ export interface FieldsMapping {
260
260
  urlAttributes?: string;
261
261
  imageUrl?: string;
262
262
  imageAttributes?: string;
263
+ sortBy?: string;
263
264
  }
264
265
  /**
265
266
  * An enum type that denotes the Expand Icon Position. Available options are as follows Right, Left;
@@ -52,7 +52,8 @@ export var ListBase;
52
52
  urlAttributes: 'urlAttributes',
53
53
  imageAttributes: 'imageAttributes',
54
54
  imageUrl: 'imageUrl',
55
- groupBy: null
55
+ groupBy: null,
56
+ sortBy: null
56
57
  };
57
58
  var defaultAriaAttributes = {
58
59
  level: 1,
@@ -212,7 +213,8 @@ export var ListBase;
212
213
  options, level, isSingleLevel, componentInstance) {
213
214
  var curOpt = extend({}, defaultListBaseOptions, options);
214
215
  cssClass = getModuleClass(curOpt.moduleName);
215
- var fields = extend({}, ListBase.defaultMappedFields, curOpt.fields);
216
+ var fields = (componentInstance &&
217
+ (componentInstance.getModuleName() == "listview" || componentInstance.getModuleName() == "multiselect")) ? curOpt.fields : extend({}, ListBase.defaultMappedFields, curOpt.fields);
216
218
  var ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes);
217
219
  var id;
218
220
  var checkboxElement = [];
@@ -586,7 +588,7 @@ export var ListBase;
586
588
  var curOpt = extend({}, defaultListBaseOptions, options);
587
589
  var curFields = extend({}, ListBase.defaultMappedFields, fields);
588
590
  // eslint-disable-next-line
589
- var compiledString = compile(template);
591
+ var compiledString = compileTemplate(template);
590
592
  var liCollection = [];
591
593
  var value;
592
594
  var id = generateId(); // generate id for drop-down-list option.
@@ -634,17 +636,27 @@ export var ListBase;
634
636
  else {
635
637
  var currentID = isHeader ? curOpt.groupTemplateID : curOpt.templateID;
636
638
  if (isHeader) {
637
- // eslint-disable-next-line
638
- var compiledElement = compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate, null, li);
639
- if (compiledElement) {
640
- append(compiledElement, li);
639
+ if (componentInstance && componentInstance.getModuleName() !== 'listview') {
640
+ // eslint-disable-next-line
641
+ var compiledElement = compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate, null, li);
642
+ if (compiledElement) {
643
+ append(compiledElement, li);
644
+ }
645
+ }
646
+ else {
647
+ append(compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate), li);
641
648
  }
642
649
  }
643
650
  else {
644
- // eslint-disable-next-line
645
- var compiledElement = compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate, null, li);
646
- if (compiledElement) {
647
- append(compiledElement, li);
651
+ if (componentInstance && componentInstance.getModuleName() !== 'listview') {
652
+ // eslint-disable-next-line
653
+ var compiledElement = compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate, null, li);
654
+ if (compiledElement) {
655
+ append(compiledElement, li);
656
+ }
657
+ }
658
+ else {
659
+ append(compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate), li);
648
660
  }
649
661
  }
650
662
  li.setAttribute('data-value', isNullOrUndefined(value) ? 'null' : value);
@@ -683,7 +695,7 @@ export var ListBase;
683
695
  // eslint-disable-next-line
684
696
  headerItems, options, componentInstance) {
685
697
  // eslint-disable-next-line @typescript-eslint/ban-types
686
- var compiledString = compile(groupTemplate);
698
+ var compiledString = compileTemplate(groupTemplate);
687
699
  var curFields = extend({}, ListBase.defaultMappedFields, fields);
688
700
  var curOpt = extend({}, defaultListBaseOptions, options);
689
701
  var category = curFields.groupBy;
@@ -692,10 +704,15 @@ export var ListBase;
692
704
  var headerData = {};
693
705
  headerData[category] = header.textContent;
694
706
  header.innerHTML = '';
695
- // eslint-disable-next-line
696
- var compiledElement = compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, header);
697
- if (compiledElement) {
698
- append(compiledElement, header);
707
+ if (componentInstance && componentInstance.getModuleName() !== 'listview') {
708
+ // eslint-disable-next-line
709
+ var compiledElement = compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, header);
710
+ if (compiledElement) {
711
+ append(compiledElement, header);
712
+ }
713
+ }
714
+ else {
715
+ append(compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), header);
699
716
  }
700
717
  }
701
718
  return headerItems;
@@ -870,20 +887,30 @@ export var ListBase;
870
887
  }
871
888
  if (grpLI && options && options.groupTemplate) {
872
889
  // eslint-disable-next-line @typescript-eslint/ban-types
873
- var compiledString = compile(options.groupTemplate);
874
- // eslint-disable-next-line
875
- var compiledElement = compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, li);
876
- if (compiledElement) {
877
- append(compiledElement, li);
890
+ var compiledString = compileTemplate(options.groupTemplate);
891
+ if (componentInstance && componentInstance.getModuleName() !== 'listview') {
892
+ // eslint-disable-next-line
893
+ var compiledElement = compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, li);
894
+ if (compiledElement) {
895
+ append(compiledElement, li);
896
+ }
897
+ }
898
+ else {
899
+ append(compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), li);
878
900
  }
879
901
  }
880
902
  else if (!grpLI && options && options.template) {
881
903
  // eslint-disable-next-line @typescript-eslint/ban-types
882
- var compiledString = compile(options.template);
883
- // eslint-disable-next-line
884
- var compiledElement = compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate, null, li);
885
- if (compiledElement) {
886
- append(compiledElement, li);
904
+ var compiledString = compileTemplate(options.template);
905
+ if (componentInstance && componentInstance.getModuleName() !== 'listview') {
906
+ // eslint-disable-next-line
907
+ var compiledElement = compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate, null, li);
908
+ if (compiledElement) {
909
+ append(compiledElement, li);
910
+ }
911
+ }
912
+ else {
913
+ append(compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate), li);
887
914
  }
888
915
  }
889
916
  else {
@@ -981,3 +1008,16 @@ export function getFieldValues(dataItem, fields) {
981
1008
  }
982
1009
  return fieldData;
983
1010
  }
1011
+ function compileTemplate(template) {
1012
+ if (template) {
1013
+ try {
1014
+ if (document.querySelector(template)) {
1015
+ return compile(document.querySelector(template).innerHTML.trim());
1016
+ }
1017
+ }
1018
+ catch (e) {
1019
+ return compile(template);
1020
+ }
1021
+ }
1022
+ return undefined;
1023
+ }
@@ -1175,14 +1175,14 @@ var ListView = /** @class */ (function (_super) {
1175
1175
  if (dataSource === void 0) { dataSource = this.localData; }
1176
1176
  if (dataSource && this.fields.groupBy) {
1177
1177
  if (this.sortOrder !== 'None') {
1178
- 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);
1179
1179
  }
1180
1180
  else {
1181
1181
  this.curViewDS = ListBase.groupDataSource(dataSource, this.listBaseOption.fields, this.sortOrder);
1182
1182
  }
1183
1183
  }
1184
1184
  else if (dataSource && this.sortOrder !== 'None') {
1185
- 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));
1186
1186
  }
1187
1187
  else {
1188
1188
  this.curViewDS = dataSource;
@@ -1,4 +1,4 @@
1
- import { Base, Event, getUniqueID, NotifyPropertyChanges, INotifyPropertyChanged, Property } from '@syncfusion/ej2-base';import { closest, Draggable, DragPosition, MouseEventArgs, remove, compareElementParent } from '@syncfusion/ej2-base';import { addClass, removeClass, isNullOrUndefined, getComponent, isBlazor, BlazorDragEventArgs } from '@syncfusion/ej2-base';
1
+ import { Base, Event, getUniqueID, NotifyPropertyChanges, INotifyPropertyChanged, Property } from '@syncfusion/ej2-base';import { closest, Draggable, DragPosition, MouseEventArgs, remove, compareElementParent } from '@syncfusion/ej2-base';import { addClass, isNullOrUndefined, getComponent, isBlazor, BlazorDragEventArgs } from '@syncfusion/ej2-base';
2
2
 
3
3
  /**
4
4
  * Interface for a class Sortable
@@ -20,7 +20,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
20
20
  /* eslint-disable @typescript-eslint/no-explicit-any */
21
21
  import { Base, Event, getUniqueID, NotifyPropertyChanges, Property } from '@syncfusion/ej2-base';
22
22
  import { closest, Draggable, remove, compareElementParent } from '@syncfusion/ej2-base';
23
- import { addClass, removeClass, isNullOrUndefined, getComponent, isBlazor } from '@syncfusion/ej2-base';
23
+ import { addClass, isNullOrUndefined, getComponent, isBlazor } from '@syncfusion/ej2-base';
24
24
  /**
25
25
  * Sortable Module provides support to enable sortable functionality in Dom Elements.
26
26
  * ```html
@@ -59,10 +59,6 @@ var Sortable = /** @class */ (function (_super) {
59
59
  element.style.height = target.offsetHeight + "px";
60
60
  }
61
61
  addClass([element], ['e-sortableclone']);
62
- removeClass([element], ['e-listboxtool-container']);
63
- if (element && element.className.indexOf("e-listbox-wrapper") < 0) {
64
- addClass([element], ['e-listbox-wrapper']);
65
- }
66
62
  document.body.appendChild(element);
67
63
  return element;
68
64
  };
@@ -175,9 +171,8 @@ var Sortable = /** @class */ (function (_super) {
175
171
  var isPlaceHolderPresent = _this.isPlaceHolderPresent(dropInst);
176
172
  if (isPlaceHolderPresent) {
177
173
  var curIdx_1 = _this.getIndex(dropInst.placeHolderElement, dropInst);
178
- var prevIndx = _this === dropInst && (prevIdx - curIdx_1) > 0 ? prevIdx - 1 : prevIdx;
179
174
  var args = {
180
- previousIndex: prevIndx, currentIndex: _this.curTarget === _this.target ? prevIndx : curIdx_1, target: e.target, droppedElement: _this.target,
175
+ previousIndex: prevIdx, currentIndex: curIdx_1, target: e.target, droppedElement: _this.target,
181
176
  helper: e.helper, cancel: false, handled: false
182
177
  };
183
178
  _this.trigger('beforeDrop', args, function (observedArgs) {
@@ -204,8 +199,7 @@ var Sortable = /** @class */ (function (_super) {
204
199
  // eslint-disable-next-line prefer-const
205
200
  curIdx = dropInst.element.childElementCount;
206
201
  prevIdx = _this.getIndex(_this.target);
207
- var target = (e.target.className.indexOf("e-list-nrt") > -1) ? e.target.parentElement : e.target;
208
- if (dropInst.element === target || (!isPlaceHolderPresent && _this.curTarget === _this.target)) {
202
+ if (dropInst.element === e.target || (!isPlaceHolderPresent && _this.curTarget === _this.target)) {
209
203
  var beforeDropArgs = {
210
204
  previousIndex: prevIdx, currentIndex: _this.curTarget === _this.target ? prevIdx : curIdx,
211
205
  target: e.target, droppedElement: _this.target, helper: e.helper, cancel: false