@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
|
var defaultAriaAttributes = {
|
|
58
59
|
level: 1,
|
|
@@ -212,7 +213,8 @@ var ListBase;
|
|
|
212
213
|
options, level, isSingleLevel, componentInstance) {
|
|
213
214
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
214
215
|
cssClass = getModuleClass(curOpt.moduleName);
|
|
215
|
-
var 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 @@ 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 =
|
|
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 @@ var ListBase;
|
|
|
634
636
|
else {
|
|
635
637
|
var currentID = isHeader ? curOpt.groupTemplateID : curOpt.templateID;
|
|
636
638
|
if (isHeader) {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
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
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
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 @@ 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 =
|
|
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 @@ var ListBase;
|
|
|
692
704
|
var headerData = {};
|
|
693
705
|
headerData[category] = header.textContent;
|
|
694
706
|
header.innerHTML = '';
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
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 @@ var ListBase;
|
|
|
870
887
|
}
|
|
871
888
|
if (grpLI && options && options.groupTemplate) {
|
|
872
889
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
873
|
-
var compiledString =
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
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 =
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
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,6 +1008,19 @@ 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
|
+
}
|
|
984
1024
|
|
|
985
1025
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
986
1026
|
var extendStatics = function (d, b) {
|
|
@@ -2149,14 +2189,14 @@ var ListView = /** @__PURE__ @class */ (function (_super) {
|
|
|
2149
2189
|
if (dataSource === void 0) { dataSource = this.localData; }
|
|
2150
2190
|
if (dataSource && this.fields.groupBy) {
|
|
2151
2191
|
if (this.sortOrder !== 'None') {
|
|
2152
|
-
this.curViewDS = ListBase.groupDataSource(ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, this.fields.sortBy)), this.listBaseOption.fields, this.sortOrder);
|
|
2192
|
+
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);
|
|
2153
2193
|
}
|
|
2154
2194
|
else {
|
|
2155
2195
|
this.curViewDS = ListBase.groupDataSource(dataSource, this.listBaseOption.fields, this.sortOrder);
|
|
2156
2196
|
}
|
|
2157
2197
|
}
|
|
2158
2198
|
else if (dataSource && this.sortOrder !== 'None') {
|
|
2159
|
-
this.curViewDS = ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, this.fields.sortBy));
|
|
2199
|
+
this.curViewDS = ListBase.getDataSource(dataSource, ListBase.addSorting(this.sortOrder, (isNullOrUndefined(this.fields.sortBy)) ? this.fields.text : this.fields.sortBy));
|
|
2160
2200
|
}
|
|
2161
2201
|
else {
|
|
2162
2202
|
this.curViewDS = dataSource;
|
|
@@ -4210,10 +4250,6 @@ var Sortable = /** @__PURE__ @class */ (function (_super) {
|
|
|
4210
4250
|
element.style.height = target.offsetHeight + "px";
|
|
4211
4251
|
}
|
|
4212
4252
|
addClass([element], ['e-sortableclone']);
|
|
4213
|
-
removeClass([element], ['e-listboxtool-container']);
|
|
4214
|
-
if (element && element.className.indexOf("e-listbox-wrapper") < 0) {
|
|
4215
|
-
addClass([element], ['e-listbox-wrapper']);
|
|
4216
|
-
}
|
|
4217
4253
|
document.body.appendChild(element);
|
|
4218
4254
|
return element;
|
|
4219
4255
|
};
|
|
@@ -4326,9 +4362,8 @@ var Sortable = /** @__PURE__ @class */ (function (_super) {
|
|
|
4326
4362
|
var isPlaceHolderPresent = _this.isPlaceHolderPresent(dropInst);
|
|
4327
4363
|
if (isPlaceHolderPresent) {
|
|
4328
4364
|
var curIdx_1 = _this.getIndex(dropInst.placeHolderElement, dropInst);
|
|
4329
|
-
var prevIndx = _this === dropInst && (prevIdx - curIdx_1) > 0 ? prevIdx - 1 : prevIdx;
|
|
4330
4365
|
var args = {
|
|
4331
|
-
previousIndex:
|
|
4366
|
+
previousIndex: prevIdx, currentIndex: curIdx_1, target: e.target, droppedElement: _this.target,
|
|
4332
4367
|
helper: e.helper, cancel: false, handled: false
|
|
4333
4368
|
};
|
|
4334
4369
|
_this.trigger('beforeDrop', args, function (observedArgs) {
|
|
@@ -4355,8 +4390,7 @@ var Sortable = /** @__PURE__ @class */ (function (_super) {
|
|
|
4355
4390
|
// eslint-disable-next-line prefer-const
|
|
4356
4391
|
curIdx = dropInst.element.childElementCount;
|
|
4357
4392
|
prevIdx = _this.getIndex(_this.target);
|
|
4358
|
-
|
|
4359
|
-
if (dropInst.element === target || (!isPlaceHolderPresent && _this.curTarget === _this.target)) {
|
|
4393
|
+
if (dropInst.element === e.target || (!isPlaceHolderPresent && _this.curTarget === _this.target)) {
|
|
4360
4394
|
var beforeDropArgs = {
|
|
4361
4395
|
previousIndex: prevIdx, currentIndex: _this.curTarget === _this.target ? prevIdx : curIdx,
|
|
4362
4396
|
target: e.target, droppedElement: _this.target, helper: e.helper, cancel: false
|