@syncfusion/ej2-lists 22.2.11 → 23.1.42
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/CHANGELOG.md +18 -54
- package/dist/ej2-lists.min.js +3 -3
- package/dist/ej2-lists.umd.min.js +3 -3
- package/dist/ej2-lists.umd.min.js.map +1 -1
- package/dist/es6/ej2-lists.es2015.js +100 -218
- package/dist/es6/ej2-lists.es2015.js.map +1 -1
- package/dist/es6/ej2-lists.es5.js +108 -237
- package/dist/es6/ej2-lists.es5.js.map +1 -1
- package/dist/global/ej2-lists.min.js +3 -3
- package/dist/global/ej2-lists.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/dist/ts/common/list-base.ts +1286 -0
- package/dist/ts/component.ts +4 -0
- package/dist/ts/list-view/list-view.ts +2653 -0
- package/dist/ts/list-view/virtualization.ts +1187 -0
- package/dist/ts/sortable/sortable.ts +485 -0
- package/package.json +9 -9
- package/src/common/list-base.d.ts +0 -6
- package/src/common/list-base.js +1 -1
- package/src/list-view/list-view-model.d.ts +7 -7
- package/src/list-view/list-view.d.ts +6 -6
- package/src/list-view/list-view.js +6 -18
- package/src/list-view/virtualization.d.ts +3 -3
- package/src/list-view/virtualization.js +101 -218
- package/styles/list-view/bootstrap-dark.scss +1 -1
- package/styles/list-view/bootstrap.scss +1 -1
- package/styles/list-view/bootstrap4.scss +1 -1
- package/styles/list-view/bootstrap5-dark.scss +1 -1
- package/styles/list-view/bootstrap5.scss +1 -1
- package/styles/list-view/fabric-dark.scss +1 -1
- package/styles/list-view/fabric.scss +1 -1
- package/styles/list-view/fluent-dark.scss +1 -1
- package/styles/list-view/fluent.scss +1 -1
- package/styles/list-view/highcontrast-light.scss +1 -1
- package/styles/list-view/highcontrast.scss +1 -1
- package/styles/list-view/material-dark.css +0 -1
- package/styles/list-view/material-dark.scss +1 -1
- package/styles/list-view/material.css +0 -1
- package/styles/list-view/material.scss +1 -1
- package/styles/list-view/material3-dark.css +0 -1
- package/styles/list-view/material3-dark.scss +1 -1
- package/styles/list-view/material3.css +0 -1
- package/styles/list-view/material3.scss +1 -1
- package/styles/list-view/tailwind-dark.css +0 -1
- package/styles/list-view/tailwind-dark.scss +1 -1
- package/styles/list-view/tailwind.css +0 -1
- package/styles/list-view/tailwind.scss +1 -1
- package/styles/material-dark.css +0 -1
- package/styles/material.css +0 -1
- package/styles/material3-dark.css +0 -1
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +0 -1
- package/styles/material3.scss +1 -1
- package/styles/sortable/bootstrap-dark.scss +1 -1
- package/styles/sortable/bootstrap.scss +1 -1
- package/styles/sortable/bootstrap4.scss +1 -1
- package/styles/sortable/bootstrap5-dark.scss +1 -1
- package/styles/sortable/bootstrap5.scss +1 -1
- package/styles/sortable/fabric-dark.scss +1 -1
- package/styles/sortable/fabric.scss +1 -1
- package/styles/sortable/fluent-dark.scss +1 -1
- package/styles/sortable/fluent.scss +1 -1
- package/styles/sortable/highcontrast-light.scss +1 -1
- package/styles/sortable/highcontrast.scss +1 -1
- package/styles/sortable/material-dark.css +0 -1
- package/styles/sortable/material-dark.scss +1 -1
- package/styles/sortable/material.css +0 -1
- package/styles/sortable/material.scss +1 -1
- package/styles/sortable/material3-dark.css +0 -1
- package/styles/sortable/material3-dark.scss +1 -1
- package/styles/sortable/material3.css +0 -1
- package/styles/sortable/material3.scss +1 -1
- package/styles/sortable/tailwind-dark.css +0 -1
- package/styles/sortable/tailwind-dark.scss +1 -1
- package/styles/sortable/tailwind.css +0 -1
- package/styles/sortable/tailwind.scss +1 -1
- package/styles/tailwind-dark.css +0 -2
- package/styles/tailwind.css +0 -2
|
@@ -22,7 +22,7 @@ import { attributes, addClass, removeClass, prepend, closest, remove } from '@sy
|
|
|
22
22
|
import { Component, EventHandler, Property, Complex, Event } from '@syncfusion/ej2-base';
|
|
23
23
|
import { NotifyPropertyChanges, ChildProperty } from '@syncfusion/ej2-base';
|
|
24
24
|
import { compile, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
|
|
25
|
-
import { Animation, rippleEffect, Touch } from '@syncfusion/ej2-base';
|
|
25
|
+
import { Animation, rippleEffect, Touch, animationMode } 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';
|
|
@@ -386,7 +386,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
386
386
|
this.element.style.overflow = 'hidden';
|
|
387
387
|
this.aniObj.animate(fromView, {
|
|
388
388
|
name: (reverse === true ? anim[0] : anim[1]),
|
|
389
|
-
duration: duration,
|
|
389
|
+
duration: (duration === 0 && animationMode === 'Enable') ? 400 : duration,
|
|
390
390
|
timingFunction: this.animation.easing,
|
|
391
391
|
// eslint-disable-next-line
|
|
392
392
|
end: function (model) {
|
|
@@ -399,7 +399,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
399
399
|
toView.style.display = '';
|
|
400
400
|
this.aniObj.animate(toView, {
|
|
401
401
|
name: (reverse === true ? anim[2] : anim[3]),
|
|
402
|
-
duration: duration,
|
|
402
|
+
duration: (duration === 0 && animationMode === 'Enable') ? 400 : duration,
|
|
403
403
|
timingFunction: this.animation.easing,
|
|
404
404
|
end: function () {
|
|
405
405
|
_this.trigger('actionComplete');
|
|
@@ -411,7 +411,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
411
411
|
ListView.prototype.preRender = function () {
|
|
412
412
|
if (this.template) {
|
|
413
413
|
try {
|
|
414
|
-
if (document.querySelectorAll(this.template).length) {
|
|
414
|
+
if (typeof this.template !== 'function' && document.querySelectorAll(this.template).length) {
|
|
415
415
|
this.setProperties({ template: document.querySelector(this.template).innerHTML.trim() }, true);
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -424,7 +424,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
424
424
|
headerTemplate: this.headerTemplate,
|
|
425
425
|
groupTemplate: this.groupTemplate, expandCollapse: true, listClass: '',
|
|
426
426
|
ariaAttributes: {
|
|
427
|
-
itemRole: 'listitem', listRole: '
|
|
427
|
+
itemRole: 'listitem', listRole: 'list', itemText: '',
|
|
428
428
|
groupItemRole: 'presentation', wrapperRole: 'presentation'
|
|
429
429
|
},
|
|
430
430
|
// eslint-disable-next-line
|
|
@@ -1371,18 +1371,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1371
1371
|
if (this.enableVirtualization) {
|
|
1372
1372
|
if (Object.keys(this.dataSource).length) {
|
|
1373
1373
|
if ((this.template || this.groupTemplate) && !this.virtualizationModule.isNgTemplate()) {
|
|
1374
|
-
if (this.isReact || this.isVue) {
|
|
1375
|
-
if (typeof this.template == "string") {
|
|
1376
|
-
this.listBaseOption.template = null;
|
|
1377
|
-
}
|
|
1378
|
-
if (typeof this.groupTemplate == "string") {
|
|
1379
|
-
this.listBaseOption.groupTemplate = null;
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
else {
|
|
1383
|
-
this.listBaseOption.template = null;
|
|
1384
|
-
this.listBaseOption.groupTemplate = null;
|
|
1385
|
-
}
|
|
1386
1374
|
this.listBaseOption.itemCreated = this.virtualizationModule.createUIItem.bind(this.virtualizationModule);
|
|
1387
1375
|
}
|
|
1388
1376
|
}
|
|
@@ -1415,7 +1403,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1415
1403
|
*/
|
|
1416
1404
|
ListView.prototype.render = function () {
|
|
1417
1405
|
this.element.classList.add(classNames.root);
|
|
1418
|
-
attributes(this.element, {
|
|
1406
|
+
attributes(this.element, { tabindex: '0' });
|
|
1419
1407
|
this.setCSSClass();
|
|
1420
1408
|
this.setEnableRTL();
|
|
1421
1409
|
this.setEnable();
|
|
@@ -31,6 +31,9 @@ export declare class Virtualization {
|
|
|
31
31
|
private uiIndices;
|
|
32
32
|
private listDiff;
|
|
33
33
|
private elementDifference;
|
|
34
|
+
private templateFunction;
|
|
35
|
+
private groupTemplateFunction;
|
|
36
|
+
private commonTemplate;
|
|
34
37
|
/**
|
|
35
38
|
* For internal use only.
|
|
36
39
|
*
|
|
@@ -80,9 +83,6 @@ export declare class Virtualization {
|
|
|
80
83
|
private compileTemplate;
|
|
81
84
|
private onChange;
|
|
82
85
|
private updateContextData;
|
|
83
|
-
private classProperty;
|
|
84
|
-
private attributeProperty;
|
|
85
|
-
private textProperty;
|
|
86
86
|
reRenderUiVirtualization(): void;
|
|
87
87
|
private updateUI;
|
|
88
88
|
/**
|
|
@@ -31,6 +31,10 @@ var Virtualization = /** @class */ (function () {
|
|
|
31
31
|
* @private
|
|
32
32
|
*/
|
|
33
33
|
Virtualization.prototype.uiVirtualization = function () {
|
|
34
|
+
this.commonTemplate = '<div class="e-text-content" role="presentation"> ' +
|
|
35
|
+
'<span class="e-list-text"> ${' + this.listViewInstance.fields.text + '} </span></div>';
|
|
36
|
+
this.templateFunction = compile(this.listViewInstance.template || this.commonTemplate, this.listViewInstance);
|
|
37
|
+
this.groupTemplateFunction = compile(this.listViewInstance.groupTemplate || this.commonTemplate, this.listViewInstance);
|
|
34
38
|
this.wireScrollEvent(false);
|
|
35
39
|
var curViewDS = this.listViewInstance.curViewDS;
|
|
36
40
|
var firstDs = curViewDS.slice(0, 1);
|
|
@@ -786,83 +790,139 @@ var Virtualization = /** @class */ (function () {
|
|
|
786
790
|
this.refreshItemHeight();
|
|
787
791
|
};
|
|
788
792
|
Virtualization.prototype.createUIItem = function (args) {
|
|
789
|
-
var
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
'<span class="e-list-text"> ${' + this.listViewInstance.fields.text + '} </span></div>';
|
|
793
|
+
var template = document.createElement('div');
|
|
794
|
+
this.templateData = args.curData.isHeader ? args.curData.items[0] :
|
|
795
|
+
args.curData;
|
|
793
796
|
if (this.listViewInstance.isReact) {
|
|
794
|
-
commonTemplate = null;
|
|
797
|
+
this.commonTemplate = null;
|
|
795
798
|
}
|
|
796
799
|
if (this.listViewInstance.showCheckBox) {
|
|
797
800
|
// eslint-disable-next-line
|
|
798
801
|
this.listViewInstance.renderCheckbox(args);
|
|
799
802
|
if ((!isNullOrUndefined(this.listViewInstance.virtualCheckBox)) &&
|
|
800
803
|
(!isNullOrUndefined(this.listViewInstance.virtualCheckBox.outerHTML))) {
|
|
801
|
-
var
|
|
802
|
-
|
|
803
|
-
if (
|
|
804
|
-
|
|
804
|
+
var div_1 = document.createElement('div');
|
|
805
|
+
var nodes = this.templateFunction(this.templateData, this.listViewInstance);
|
|
806
|
+
if (this.listViewInstance.template && this.listViewInstance.isReact) {
|
|
807
|
+
this.listViewInstance.renderReactTemplates();
|
|
808
|
+
}
|
|
809
|
+
[].slice.call(nodes).forEach(function (ele) {
|
|
810
|
+
div_1.appendChild(ele);
|
|
811
|
+
});
|
|
812
|
+
if (div_1.children && div_1.children[0]) {
|
|
813
|
+
div_1.children[0].classList.add('e-checkbox');
|
|
805
814
|
if (this.listViewInstance.checkBoxPosition === 'Left') {
|
|
806
|
-
|
|
815
|
+
div_1.children[0].classList.add('e-checkbox-left');
|
|
807
816
|
}
|
|
808
817
|
else {
|
|
809
|
-
|
|
818
|
+
div_1.children[0].classList.add('e-checkbox-right');
|
|
810
819
|
}
|
|
811
820
|
if (this.listViewInstance.checkBoxPosition === 'Left') {
|
|
812
|
-
|
|
821
|
+
div_1.children[0].insertBefore(this.listViewInstance.virtualCheckBox, div_1.childNodes[0].children[0]);
|
|
813
822
|
}
|
|
814
823
|
else {
|
|
815
|
-
|
|
824
|
+
div_1.children[0].appendChild(this.listViewInstance.virtualCheckBox);
|
|
816
825
|
}
|
|
817
|
-
|
|
826
|
+
template.innerHTML = div_1.innerHTML;
|
|
818
827
|
}
|
|
819
828
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
829
|
+
else {
|
|
830
|
+
var div_2 = document.createElement('div');
|
|
831
|
+
var nodes = this.templateFunction(this.templateData, this.listViewInstance);
|
|
832
|
+
if (this.listViewInstance.template && this.listViewInstance.isReact) {
|
|
833
|
+
this.listViewInstance.renderReactTemplates();
|
|
834
|
+
}
|
|
835
|
+
[].slice.call(nodes).forEach(function (ele) {
|
|
836
|
+
div_2.appendChild(ele);
|
|
837
|
+
});
|
|
838
|
+
template.innerHTML = div_2.innerHTML;
|
|
839
|
+
}
|
|
824
840
|
}
|
|
825
841
|
else {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
if (this.listViewInstance.fields.groupBy) {
|
|
834
|
-
groupTemplate.innerHTML = this.listViewInstance.groupTemplate || commonTemplate;
|
|
842
|
+
var nodes = this.templateFunction(this.templateData, this.listViewInstance);
|
|
843
|
+
if (this.listViewInstance.template && this.listViewInstance.isReact) {
|
|
844
|
+
this.listViewInstance.renderReactTemplates();
|
|
845
|
+
}
|
|
846
|
+
[].slice.call(nodes).forEach(function (ele) {
|
|
847
|
+
template.appendChild(ele);
|
|
848
|
+
});
|
|
835
849
|
}
|
|
836
|
-
// eslint-disable-next-line
|
|
837
|
-
var groupTemplateElements = groupTemplate.getElementsByTagName('*');
|
|
838
850
|
if (args.curData.isHeader) {
|
|
839
851
|
this.headerData = args.curData;
|
|
840
852
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
(
|
|
853
|
+
var groupTemplate = this.listViewInstance.createElement('div');
|
|
854
|
+
if (this.listViewInstance.fields.groupBy) {
|
|
855
|
+
var nodes = this.groupTemplateFunction(this.headerData, this.listViewInstance);
|
|
856
|
+
if (this.listViewInstance.template && this.listViewInstance.isReact) {
|
|
857
|
+
this.listViewInstance.renderReactTemplates();
|
|
858
|
+
}
|
|
859
|
+
[].slice.call(nodes).forEach(function (ele) {
|
|
860
|
+
groupTemplate.appendChild(ele);
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
if ((!this.listViewInstance.isReact || (typeof this.listViewInstance.template == "string" && !args.item.classList.contains("e-list-group-item")) ||
|
|
864
|
+
(typeof this.listViewInstance.groupTemplate == "string" && args.item.classList.contains("e-list-group-item"))) && !this.listViewInstance.isVue) {
|
|
845
865
|
args.item.innerHTML = '';
|
|
846
866
|
}
|
|
847
867
|
args.item.context = { data: args.curData, nodes: { flatTemplateNodes: [], groupTemplateNodes: [] } };
|
|
848
|
-
for (var i = 0; i <
|
|
849
|
-
this.compileTemplate(
|
|
868
|
+
for (var i = 0; i < template.children.length; i++) {
|
|
869
|
+
this.compileTemplate(template.children[i], args.item, false);
|
|
850
870
|
}
|
|
851
|
-
for (var i = 0; i <
|
|
852
|
-
this.compileTemplate(
|
|
871
|
+
for (var i = 0; i < groupTemplate.children.length; i++) {
|
|
872
|
+
this.compileTemplate(groupTemplate.children[i], args.item, true);
|
|
853
873
|
}
|
|
854
874
|
args.item.context.template = args.curData.isHeader ? template.firstElementChild :
|
|
855
875
|
groupTemplate.firstElementChild;
|
|
856
876
|
args.item.context.type = args.curData.isHeader ? 'flatList' : 'groupList';
|
|
857
877
|
var element = args.curData.isHeader ? groupTemplate : template;
|
|
858
|
-
if (element.firstElementChild) {
|
|
878
|
+
if (element.firstElementChild && !this.listViewInstance.isReact && !this.listViewInstance.isVue) {
|
|
859
879
|
args.item.insertBefore(element.firstElementChild, null);
|
|
860
880
|
}
|
|
861
881
|
};
|
|
862
882
|
Virtualization.prototype.compileTemplate = function (element, item, isHeader) {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
883
|
+
var _this = this;
|
|
884
|
+
var subNode = {};
|
|
885
|
+
subNode.onChange = function (value) {
|
|
886
|
+
var groupTemplateElements;
|
|
887
|
+
var templateElements;
|
|
888
|
+
if (_this.listViewInstance.isVue) {
|
|
889
|
+
groupTemplateElements = _this.groupTemplateFunction(value);
|
|
890
|
+
templateElements = _this.templateFunction(value);
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
groupTemplateElements = _this.groupTemplateFunction(value, _this.listViewInstance);
|
|
894
|
+
templateElements = _this.templateFunction(value, _this.listViewInstance);
|
|
895
|
+
}
|
|
896
|
+
if (_this.listViewInstance.template && _this.listViewInstance.isReact) {
|
|
897
|
+
_this.listViewInstance.renderReactTemplates();
|
|
898
|
+
}
|
|
899
|
+
var currentTemplate = templateElements;
|
|
900
|
+
if (value.isHeader) {
|
|
901
|
+
currentTemplate = groupTemplateElements;
|
|
902
|
+
}
|
|
903
|
+
[].slice.call(currentTemplate).forEach(function (currentElement) {
|
|
904
|
+
var RemovableClass = element.classList.value.replace('e-checkbox', '');
|
|
905
|
+
RemovableClass = RemovableClass.replace('e-checkbox-left', '');
|
|
906
|
+
RemovableClass = RemovableClass.replace('e-checkbox-right', '');
|
|
907
|
+
removeClass([element], RemovableClass.split(' ').filter(function (css) { return css; }));
|
|
908
|
+
addClass([element], Array.from(currentElement.classList));
|
|
909
|
+
for (var i = 0; i < element.attributes.length; i++) {
|
|
910
|
+
if (element.attributes[i].name != 'class') {
|
|
911
|
+
var newData = currentElement.getAttribute(element.attributes[i].name);
|
|
912
|
+
element.setAttribute(element.attributes[i].name, newData);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
[].slice.call(element.children).forEach(function (ele) {
|
|
916
|
+
if (!ele.classList.contains('e-listview-checkbox') && !(ele.classList.contains('e-checkbox-left') || ele.classList.contains('e-checkbox-right'))) {
|
|
917
|
+
ele.remove();
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
[].slice.call(currentElement.children).forEach(function (ele) {
|
|
921
|
+
element.appendChild(ele);
|
|
922
|
+
});
|
|
923
|
+
});
|
|
924
|
+
};
|
|
925
|
+
this.updateContextData(item, subNode, isHeader);
|
|
866
926
|
};
|
|
867
927
|
Virtualization.prototype.onChange = function (newData, listElement) {
|
|
868
928
|
listElement.context.data = newData;
|
|
@@ -916,183 +976,6 @@ var Virtualization = /** @class */ (function () {
|
|
|
916
976
|
listElement.context.nodes.flatTemplateNodes.push(node);
|
|
917
977
|
}
|
|
918
978
|
};
|
|
919
|
-
Virtualization.prototype.classProperty = function (element, listElement, isHeader) {
|
|
920
|
-
var regex = new RegExp('\\${([^}]*)}', 'g');
|
|
921
|
-
var resultantOutput = [];
|
|
922
|
-
var regexMatch;
|
|
923
|
-
while (regexMatch !== null) {
|
|
924
|
-
var match = regex.exec(element.className);
|
|
925
|
-
resultantOutput.push(match);
|
|
926
|
-
regexMatch = match;
|
|
927
|
-
if (regexMatch === null) {
|
|
928
|
-
resultantOutput.pop();
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
if (resultantOutput && resultantOutput.length) {
|
|
932
|
-
var _loop_1 = function (i) {
|
|
933
|
-
var classNameMatch = resultantOutput[i];
|
|
934
|
-
// eslint-disable-next-line
|
|
935
|
-
var classFunction;
|
|
936
|
-
if (classNameMatch[1].indexOf('?') !== -1 && classNameMatch[1].indexOf(':') !== -1) {
|
|
937
|
-
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
938
|
-
classFunction = new Function('data', 'return ' + classNameMatch[1].replace(/\$/g, 'data.'));
|
|
939
|
-
}
|
|
940
|
-
else {
|
|
941
|
-
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
942
|
-
classFunction = new Function('data', 'return ' + 'data.' + classNameMatch[1]);
|
|
943
|
-
}
|
|
944
|
-
// eslint-disable-next-line
|
|
945
|
-
var subNode = {};
|
|
946
|
-
if (isHeader) {
|
|
947
|
-
subNode.bindedvalue = classFunction(this_1.headerData);
|
|
948
|
-
}
|
|
949
|
-
else {
|
|
950
|
-
subNode.bindedvalue = classFunction(this_1.templateData);
|
|
951
|
-
}
|
|
952
|
-
subNode.onChange = function (value) {
|
|
953
|
-
if (subNode.bindedvalue) {
|
|
954
|
-
removeClass([element], subNode.bindedvalue.split(' ').filter(function (css) { return css; }));
|
|
955
|
-
}
|
|
956
|
-
var newCss = classFunction(value);
|
|
957
|
-
if (newCss) {
|
|
958
|
-
addClass([element], (newCss).split(' ').filter(function (css) { return css; }));
|
|
959
|
-
}
|
|
960
|
-
subNode.bindedvalue = newCss;
|
|
961
|
-
};
|
|
962
|
-
var className = classNameMatch[0].split(' ');
|
|
963
|
-
for (var i_1 = 0; i_1 < className.length; i_1++) {
|
|
964
|
-
element.classList.remove(className[i_1]);
|
|
965
|
-
}
|
|
966
|
-
if (subNode.bindedvalue) {
|
|
967
|
-
addClass([element], subNode.bindedvalue.split(' ').filter(function (css) { return css; }));
|
|
968
|
-
}
|
|
969
|
-
this_1.updateContextData(listElement, subNode, isHeader);
|
|
970
|
-
};
|
|
971
|
-
var this_1 = this;
|
|
972
|
-
for (var i = 0; i < resultantOutput.length; i++) {
|
|
973
|
-
_loop_1(i);
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
Virtualization.prototype.attributeProperty = function (element, listElement, isHeader) {
|
|
978
|
-
var attributeNames = [];
|
|
979
|
-
for (var i = 0; i < element.attributes.length; i++) {
|
|
980
|
-
attributeNames.push(element.attributes[i].nodeName);
|
|
981
|
-
}
|
|
982
|
-
if (attributeNames.indexOf('class') !== -1) {
|
|
983
|
-
attributeNames.splice(attributeNames.indexOf('class'), 1);
|
|
984
|
-
}
|
|
985
|
-
var _loop_2 = function (i) {
|
|
986
|
-
var attributeName = attributeNames[i];
|
|
987
|
-
var attrNameMatch = new RegExp('\\${([^}]*)}', 'g').exec(attributeName) || [];
|
|
988
|
-
var attrValueMatch = new RegExp('\\${([^}]*)}', 'g').exec(element.getAttribute(attributeName))
|
|
989
|
-
|| [];
|
|
990
|
-
// eslint-disable-next-line
|
|
991
|
-
var attributeNameFunction;
|
|
992
|
-
// eslint-disable-next-line
|
|
993
|
-
var attributeValueFunction;
|
|
994
|
-
if (attrNameMatch.length || attrValueMatch.length) {
|
|
995
|
-
if (attrNameMatch[1]) {
|
|
996
|
-
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
997
|
-
attributeNameFunction = new Function('data', 'return ' + 'data.' + attrNameMatch[1]);
|
|
998
|
-
}
|
|
999
|
-
if (attrValueMatch[1]) {
|
|
1000
|
-
if (attrValueMatch[1].indexOf('?') !== -1 && attrValueMatch[1].indexOf(':') !== -1) {
|
|
1001
|
-
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
1002
|
-
attributeValueFunction = new Function('data', 'return ' + attrValueMatch[1].replace(/\$/g, 'data.'));
|
|
1003
|
-
}
|
|
1004
|
-
else {
|
|
1005
|
-
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
1006
|
-
attributeValueFunction = new Function('data', 'return ' + 'data.' + attrValueMatch[1]);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1010
|
-
var subNode_1 = {};
|
|
1011
|
-
if (isHeader) {
|
|
1012
|
-
subNode_1.bindedvalue = [attrNameMatch[1] === undefined ? undefined : attributeNameFunction(this_2.headerData),
|
|
1013
|
-
attrValueMatch[1] === undefined ? undefined : attributeValueFunction(this_2.headerData)];
|
|
1014
|
-
}
|
|
1015
|
-
else {
|
|
1016
|
-
subNode_1.bindedvalue = [attrNameMatch[1] === undefined ? undefined : attributeNameFunction(this_2.templateData),
|
|
1017
|
-
attrValueMatch[1] === undefined ? undefined : attributeValueFunction(this_2.templateData)];
|
|
1018
|
-
}
|
|
1019
|
-
subNode_1.attrName = subNode_1.bindedvalue[0] === undefined ?
|
|
1020
|
-
attributeName : subNode_1.bindedvalue[0];
|
|
1021
|
-
subNode_1.onChange = function (value) {
|
|
1022
|
-
var bindedvalue = subNode_1.bindedvalue[1] === undefined ?
|
|
1023
|
-
element.getAttribute(subNode_1.attrName) : attributeValueFunction(value);
|
|
1024
|
-
element.removeAttribute(subNode_1.attrName);
|
|
1025
|
-
subNode_1.attrName = subNode_1.bindedvalue[0] === undefined ? subNode_1.attrName : attributeNameFunction(value);
|
|
1026
|
-
element.setAttribute(subNode_1.attrName, bindedvalue);
|
|
1027
|
-
subNode_1.bindedvalue = [subNode_1.bindedvalue[0] === undefined ? undefined : attributeNameFunction(value),
|
|
1028
|
-
subNode_1.bindedvalue[1] === undefined ? undefined : attributeValueFunction(value)];
|
|
1029
|
-
};
|
|
1030
|
-
var attributeValue = subNode_1.bindedvalue[1] === undefined ? element.getAttribute(attributeName) :
|
|
1031
|
-
subNode_1.bindedvalue[1];
|
|
1032
|
-
element.removeAttribute(attributeName);
|
|
1033
|
-
element.setAttribute(subNode_1.attrName, attributeValue);
|
|
1034
|
-
this_2.updateContextData(listElement, subNode_1, isHeader);
|
|
1035
|
-
}
|
|
1036
|
-
};
|
|
1037
|
-
var this_2 = this;
|
|
1038
|
-
for (var i = 0; i < attributeNames.length; i++) {
|
|
1039
|
-
_loop_2(i);
|
|
1040
|
-
}
|
|
1041
|
-
};
|
|
1042
|
-
Virtualization.prototype.textProperty = function (element, listElement, isHeader) {
|
|
1043
|
-
var regex = new RegExp('\\${([^}]*)}', 'g');
|
|
1044
|
-
var resultantOutput = [];
|
|
1045
|
-
var regexMatch;
|
|
1046
|
-
while (regexMatch !== null) {
|
|
1047
|
-
var match = regex.exec(element.innerText);
|
|
1048
|
-
resultantOutput.push(match);
|
|
1049
|
-
regexMatch = match;
|
|
1050
|
-
if (regexMatch === null) {
|
|
1051
|
-
resultantOutput.pop();
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
var isChildHasTextContent = Array.prototype.some.call(element.children, function (element) {
|
|
1055
|
-
if (new RegExp('\\${([^}]*)}', 'g').exec(element.innerText)) {
|
|
1056
|
-
return true;
|
|
1057
|
-
}
|
|
1058
|
-
else {
|
|
1059
|
-
return false;
|
|
1060
|
-
}
|
|
1061
|
-
});
|
|
1062
|
-
if (resultantOutput && resultantOutput.length && !isChildHasTextContent) {
|
|
1063
|
-
var _loop_3 = function (i) {
|
|
1064
|
-
var textPropertyMatch = resultantOutput[i];
|
|
1065
|
-
// eslint-disable-next-line
|
|
1066
|
-
var subNode = {};
|
|
1067
|
-
// eslint-disable-next-line
|
|
1068
|
-
var textFunction;
|
|
1069
|
-
if (textPropertyMatch[1].indexOf('?') !== -1 && textPropertyMatch[1].indexOf(':') !== -1) {
|
|
1070
|
-
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
1071
|
-
textFunction = new Function('data', 'return ' + textPropertyMatch[1].replace(/\$/g, 'data.'));
|
|
1072
|
-
}
|
|
1073
|
-
else {
|
|
1074
|
-
// tslint:disable-next-line:no-function-constructor-with-string-args
|
|
1075
|
-
textFunction = new Function('data', 'return ' + 'data.' + textPropertyMatch[1]);
|
|
1076
|
-
}
|
|
1077
|
-
if (isHeader) {
|
|
1078
|
-
subNode.bindedvalue = textFunction(this_3.headerData);
|
|
1079
|
-
}
|
|
1080
|
-
else {
|
|
1081
|
-
subNode.bindedvalue = textFunction(this_3.templateData);
|
|
1082
|
-
}
|
|
1083
|
-
subNode.onChange = function (value) {
|
|
1084
|
-
element.innerText = element.innerText.replace(subNode.bindedvalue, textFunction(value));
|
|
1085
|
-
subNode.bindedvalue = textFunction(value);
|
|
1086
|
-
};
|
|
1087
|
-
element.innerText = element.innerText.replace(textPropertyMatch[0], subNode.bindedvalue);
|
|
1088
|
-
this_3.updateContextData(listElement, subNode, isHeader);
|
|
1089
|
-
};
|
|
1090
|
-
var this_3 = this;
|
|
1091
|
-
for (var i = 0; i < resultantOutput.length; i++) {
|
|
1092
|
-
_loop_3(i);
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
};
|
|
1096
979
|
Virtualization.prototype.reRenderUiVirtualization = function () {
|
|
1097
980
|
this.wireScrollEvent(true);
|
|
1098
981
|
if (this.listViewInstance.contentContainer) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import 'ej2-base/styles/bootstrap-dark
|
|
1
|
+
@import 'ej2-base/styles/definition/bootstrap-dark.scss';
|
|
2
2
|
@import 'ej2-buttons/styles/check-box/bootstrap-dark-definition.scss';
|
|
3
3
|
@import 'bootstrap-dark-definition.scss';
|
|
4
4
|
@import 'icons/bootstrap-dark.scss';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import 'ej2-base/styles/bootstrap5-dark
|
|
1
|
+
@import 'ej2-base/styles/definition/bootstrap5-dark.scss';
|
|
2
2
|
@import 'ej2-buttons/styles/check-box/bootstrap5-dark-definition.scss';
|
|
3
3
|
@import 'bootstrap5-dark-definition.scss';
|
|
4
4
|
@import 'icons/bootstrap5-dark.scss';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import 'ej2-base/styles/highcontrast-light
|
|
1
|
+
@import 'ej2-base/styles/definition/highcontrast-light.scss';
|
|
2
2
|
@import 'ej2-buttons/styles/check-box/highcontrast-light-definition.scss';
|
|
3
3
|
@import 'highcontrast-light-definition.scss';
|
|
4
4
|
@import 'icons/highcontrast-light.scss';
|
package/styles/material-dark.css
CHANGED
package/styles/material.css
CHANGED