@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.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.md +24 -0
- package/dist/ej2-lists.umd.min.js +2 -2
- package/dist/ej2-lists.umd.min.js.map +1 -1
- package/dist/es6/ej2-lists.es2015.js +70 -36
- package/dist/es6/ej2-lists.es2015.js.map +1 -1
- package/dist/es6/ej2-lists.es5.js +70 -36
- package/dist/es6/ej2-lists.es5.js.map +1 -1
- package/dist/global/ej2-lists.min.js +2 -2
- package/dist/global/ej2-lists.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/common/list-base.d.ts +1 -0
- package/src/common/list-base.js +66 -26
- package/src/list-view/list-view.js +2 -2
- package/src/sortable/sortable-model.d.ts +1 -1
- package/src/sortable/sortable.js +3 -9
- package/styles/bootstrap5-dark.css +533 -0
- package/styles/bootstrap5-dark.scss +2 -0
- package/styles/bootstrap5.css +533 -0
- package/styles/bootstrap5.scss +2 -0
- package/styles/list-view/_bootstrap5-dark-definition.scss +1 -0
- package/styles/list-view/_bootstrap5-definition.scss +129 -0
- package/styles/list-view/_layout.scss +26 -26
- package/styles/list-view/_tailwind-dark-definition.scss +1 -116
- package/styles/list-view/_tailwind-definition.scss +33 -29
- package/styles/list-view/_theme.scss +35 -10
- package/styles/list-view/bootstrap5-dark.css +506 -0
- package/styles/list-view/bootstrap5-dark.scss +5 -0
- package/styles/list-view/bootstrap5.css +506 -0
- package/styles/list-view/bootstrap5.scss +5 -0
- package/styles/list-view/icons/_bootstrap5-dark.scss +1 -0
- package/styles/list-view/icons/_bootstrap5.scss +8 -0
- package/styles/list-view/material-dark.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/sortable/bootstrap5-dark.css +26 -0
- package/styles/sortable/bootstrap5-dark.scss +2 -0
- package/styles/sortable/bootstrap5.css +26 -0
- package/styles/sortable/bootstrap5.scss +2 -0
|
@@ -52,7 +52,8 @@ 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
|
const defaultAriaAttributes = {
|
|
58
59
|
level: 1,
|
|
@@ -212,7 +213,8 @@ var ListBase;
|
|
|
212
213
|
options, level, isSingleLevel, componentInstance) {
|
|
213
214
|
const curOpt = extend({}, defaultListBaseOptions, options);
|
|
214
215
|
cssClass = getModuleClass(curOpt.moduleName);
|
|
215
|
-
const fields =
|
|
216
|
+
const fields = (componentInstance &&
|
|
217
|
+
(componentInstance.getModuleName() == "listview" || componentInstance.getModuleName() == "multiselect")) ? curOpt.fields : extend({}, ListBase.defaultMappedFields, curOpt.fields);
|
|
216
218
|
const ariaAttributes = extend({}, defaultAriaAttributes, curOpt.ariaAttributes);
|
|
217
219
|
let id;
|
|
218
220
|
let checkboxElement = [];
|
|
@@ -584,7 +586,7 @@ var ListBase;
|
|
|
584
586
|
const curOpt = extend({}, defaultListBaseOptions, options);
|
|
585
587
|
const curFields = extend({}, ListBase.defaultMappedFields, fields);
|
|
586
588
|
// eslint-disable-next-line
|
|
587
|
-
const compiledString =
|
|
589
|
+
const compiledString = compileTemplate(template);
|
|
588
590
|
const liCollection = [];
|
|
589
591
|
let value;
|
|
590
592
|
const id = generateId(); // generate id for drop-down-list option.
|
|
@@ -632,17 +634,27 @@ var ListBase;
|
|
|
632
634
|
else {
|
|
633
635
|
const currentID = isHeader ? curOpt.groupTemplateID : curOpt.templateID;
|
|
634
636
|
if (isHeader) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
637
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
638
|
+
// eslint-disable-next-line
|
|
639
|
+
const compiledElement = compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate, null, li);
|
|
640
|
+
if (compiledElement) {
|
|
641
|
+
append(compiledElement, li);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
append(compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate), li);
|
|
639
646
|
}
|
|
640
647
|
}
|
|
641
648
|
else {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
649
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
650
|
+
// eslint-disable-next-line
|
|
651
|
+
const compiledElement = compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate, null, li);
|
|
652
|
+
if (compiledElement) {
|
|
653
|
+
append(compiledElement, li);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
append(compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate), li);
|
|
646
658
|
}
|
|
647
659
|
}
|
|
648
660
|
li.setAttribute('data-value', isNullOrUndefined(value) ? 'null' : value);
|
|
@@ -681,7 +693,7 @@ var ListBase;
|
|
|
681
693
|
// eslint-disable-next-line
|
|
682
694
|
headerItems, options, componentInstance) {
|
|
683
695
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
684
|
-
const compiledString =
|
|
696
|
+
const compiledString = compileTemplate(groupTemplate);
|
|
685
697
|
const curFields = extend({}, ListBase.defaultMappedFields, fields);
|
|
686
698
|
const curOpt = extend({}, defaultListBaseOptions, options);
|
|
687
699
|
const category = curFields.groupBy;
|
|
@@ -689,10 +701,15 @@ var ListBase;
|
|
|
689
701
|
const headerData = {};
|
|
690
702
|
headerData[category] = header.textContent;
|
|
691
703
|
header.innerHTML = '';
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
704
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
705
|
+
// eslint-disable-next-line
|
|
706
|
+
const compiledElement = compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, header);
|
|
707
|
+
if (compiledElement) {
|
|
708
|
+
append(compiledElement, header);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
append(compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), header);
|
|
696
713
|
}
|
|
697
714
|
}
|
|
698
715
|
return headerItems;
|
|
@@ -867,20 +884,30 @@ var ListBase;
|
|
|
867
884
|
}
|
|
868
885
|
if (grpLI && options && options.groupTemplate) {
|
|
869
886
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
870
|
-
const compiledString =
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
887
|
+
const compiledString = compileTemplate(options.groupTemplate);
|
|
888
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
889
|
+
// eslint-disable-next-line
|
|
890
|
+
const compiledElement = compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, li);
|
|
891
|
+
if (compiledElement) {
|
|
892
|
+
append(compiledElement, li);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
else {
|
|
896
|
+
append(compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), li);
|
|
875
897
|
}
|
|
876
898
|
}
|
|
877
899
|
else if (!grpLI && options && options.template) {
|
|
878
900
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
879
|
-
const compiledString =
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
901
|
+
const compiledString = compileTemplate(options.template);
|
|
902
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
903
|
+
// eslint-disable-next-line
|
|
904
|
+
const compiledElement = compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate, null, li);
|
|
905
|
+
if (compiledElement) {
|
|
906
|
+
append(compiledElement, li);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
else {
|
|
910
|
+
append(compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate), li);
|
|
884
911
|
}
|
|
885
912
|
}
|
|
886
913
|
else {
|
|
@@ -977,6 +1004,19 @@ function getFieldValues(dataItem, fields) {
|
|
|
977
1004
|
}
|
|
978
1005
|
return fieldData;
|
|
979
1006
|
}
|
|
1007
|
+
function compileTemplate(template) {
|
|
1008
|
+
if (template) {
|
|
1009
|
+
try {
|
|
1010
|
+
if (document.querySelector(template)) {
|
|
1011
|
+
return compile(document.querySelector(template).innerHTML.trim());
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
catch (e) {
|
|
1015
|
+
return compile(template);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return undefined;
|
|
1019
|
+
}
|
|
980
1020
|
|
|
981
1021
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
982
1022
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2116,14 +2156,14 @@ let ListView = class ListView extends Component {
|
|
|
2116
2156
|
setViewDataSource(dataSource = this.localData) {
|
|
2117
2157
|
if (dataSource && this.fields.groupBy) {
|
|
2118
2158
|
if (this.sortOrder !== 'None') {
|
|
2119
|
-
this.curViewDS = ListBase.groupDataSource(ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, this.fields.sortBy)), this.listBaseOption.fields, this.sortOrder);
|
|
2159
|
+
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);
|
|
2120
2160
|
}
|
|
2121
2161
|
else {
|
|
2122
2162
|
this.curViewDS = ListBase.groupDataSource(dataSource, this.listBaseOption.fields, this.sortOrder);
|
|
2123
2163
|
}
|
|
2124
2164
|
}
|
|
2125
2165
|
else if (dataSource && this.sortOrder !== 'None') {
|
|
2126
|
-
this.curViewDS = ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, this.fields.sortBy));
|
|
2166
|
+
this.curViewDS = ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, (isNullOrUndefined(this.fields.sortBy)) ? this.fields.text : this.fields.sortBy));
|
|
2127
2167
|
}
|
|
2128
2168
|
else {
|
|
2129
2169
|
this.curViewDS = dataSource;
|
|
@@ -4140,10 +4180,6 @@ let Sortable = Sortable_1 = class Sortable extends Base {
|
|
|
4140
4180
|
element.style.height = `${target.offsetHeight}px`;
|
|
4141
4181
|
}
|
|
4142
4182
|
addClass([element], ['e-sortableclone']);
|
|
4143
|
-
removeClass([element], ['e-listboxtool-container']);
|
|
4144
|
-
if (element && element.className.indexOf("e-listbox-wrapper") < 0) {
|
|
4145
|
-
addClass([element], ['e-listbox-wrapper']);
|
|
4146
|
-
}
|
|
4147
4183
|
document.body.appendChild(element);
|
|
4148
4184
|
return element;
|
|
4149
4185
|
};
|
|
@@ -4256,9 +4292,8 @@ let Sortable = Sortable_1 = class Sortable extends Base {
|
|
|
4256
4292
|
const isPlaceHolderPresent = this.isPlaceHolderPresent(dropInst);
|
|
4257
4293
|
if (isPlaceHolderPresent) {
|
|
4258
4294
|
const curIdx = this.getIndex(dropInst.placeHolderElement, dropInst);
|
|
4259
|
-
let prevIndx = this === dropInst && (prevIdx - curIdx) > 0 ? prevIdx - 1 : prevIdx;
|
|
4260
4295
|
const args = {
|
|
4261
|
-
previousIndex:
|
|
4296
|
+
previousIndex: prevIdx, currentIndex: curIdx, target: e.target, droppedElement: this.target,
|
|
4262
4297
|
helper: e.helper, cancel: false, handled: false
|
|
4263
4298
|
};
|
|
4264
4299
|
this.trigger('beforeDrop', args, (observedArgs) => {
|
|
@@ -4285,8 +4320,7 @@ let Sortable = Sortable_1 = class Sortable extends Base {
|
|
|
4285
4320
|
// eslint-disable-next-line prefer-const
|
|
4286
4321
|
curIdx = dropInst.element.childElementCount;
|
|
4287
4322
|
prevIdx = this.getIndex(this.target);
|
|
4288
|
-
|
|
4289
|
-
if (dropInst.element === target || (!isPlaceHolderPresent && this.curTarget === this.target)) {
|
|
4323
|
+
if (dropInst.element === e.target || (!isPlaceHolderPresent && this.curTarget === this.target)) {
|
|
4290
4324
|
const beforeDropArgs = {
|
|
4291
4325
|
previousIndex: prevIdx, currentIndex: this.curTarget === this.target ? prevIdx : curIdx,
|
|
4292
4326
|
target: e.target, droppedElement: this.target, helper: e.helper, cancel: false
|