@syncfusion/ej2-lists 22.2.9 → 23.1.36
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 -46
- package/dist/ej2-lists.min.js +2 -2
- 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 +103 -218
- package/dist/es6/ej2-lists.es2015.js.map +1 -1
- package/dist/es6/ej2-lists.es5.js +111 -237
- 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 +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 +9 -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
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 23.1.36
|
|
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@22.
|
|
3
|
+
"_id": "@syncfusion/ej2-lists@18.22.1",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-JFrpWovANLrajmaJBnTd1sYN4tNzGfUtg0iAOELaO/ArE8T5G9Kmnh+JUqfrpqzy4/3GX7YVRkW3veoLTE+9JQ==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-lists",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"/@syncfusion/ej2-schedule",
|
|
36
36
|
"/@syncfusion/ej2-vue-lists"
|
|
37
37
|
],
|
|
38
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-
|
|
39
|
-
"_shasum": "
|
|
38
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-lists/-/ej2-lists-18.22.1.tgz",
|
|
39
|
+
"_shasum": "0e6368d9418ddf6e513951dc48b73eb3c4728667",
|
|
40
40
|
"_spec": "@syncfusion/ej2-lists@*",
|
|
41
|
-
"_where": "/jenkins/workspace/elease-
|
|
41
|
+
"_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
|
|
42
42
|
"author": {
|
|
43
43
|
"name": "Syncfusion Inc."
|
|
44
44
|
},
|
|
45
45
|
"bundleDependencies": false,
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@syncfusion/ej2-base": "~
|
|
48
|
-
"@syncfusion/ej2-buttons": "~
|
|
49
|
-
"@syncfusion/ej2-data": "~
|
|
47
|
+
"@syncfusion/ej2-base": "~23.1.36",
|
|
48
|
+
"@syncfusion/ej2-buttons": "~23.1.36",
|
|
49
|
+
"@syncfusion/ej2-data": "~23.1.36"
|
|
50
50
|
},
|
|
51
51
|
"deprecated": false,
|
|
52
52
|
"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.",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/lists"
|
|
87
87
|
},
|
|
88
88
|
"typings": "index.d.ts",
|
|
89
|
-
"version": "
|
|
89
|
+
"version": "23.1.36",
|
|
90
90
|
"sideEffects": false,
|
|
91
91
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
92
92
|
}
|
|
@@ -319,20 +319,14 @@ export interface ListBaseOptions {
|
|
|
319
319
|
sortOrder?: SortOrder;
|
|
320
320
|
/**
|
|
321
321
|
* Specifies the item template
|
|
322
|
-
*
|
|
323
|
-
* @aspType string
|
|
324
322
|
*/
|
|
325
323
|
template?: string | Function;
|
|
326
324
|
/**
|
|
327
325
|
* Specifies the group header template
|
|
328
|
-
*
|
|
329
|
-
* @aspType string
|
|
330
326
|
*/
|
|
331
327
|
groupTemplate?: string | Function;
|
|
332
328
|
/**
|
|
333
329
|
* Specifies the ListView header template
|
|
334
|
-
*
|
|
335
|
-
* @aspType string
|
|
336
330
|
*/
|
|
337
331
|
headerTemplate?: string | Function;
|
|
338
332
|
/**
|
package/src/common/list-base.js
CHANGED
|
@@ -280,7 +280,7 @@ export var ListBase;
|
|
|
280
280
|
li = generateLI(createElement, curItem, fieldData, fields, curOpt.itemClass, options, componentInstance);
|
|
281
281
|
li.classList.add(cssClass.level + '-' + ariaAttributes.level);
|
|
282
282
|
li.setAttribute('aria-level', ariaAttributes.level.toString());
|
|
283
|
-
if (ariaAttributes.groupItemRole == 'presentation') {
|
|
283
|
+
if (ariaAttributes.groupItemRole == 'presentation' || ariaAttributes.itemRole == 'presentation') {
|
|
284
284
|
li.removeAttribute('aria-level');
|
|
285
285
|
}
|
|
286
286
|
anchorElement = li.querySelector('.' + cssClass.anchorWrap);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Virtualization } from './virtualization';import { merge, formatUnit, isNullOrUndefined, append, detach, ModuleDeclaration, extend } from '@syncfusion/ej2-base';import { attributes, addClass, removeClass, prepend, closest, remove } from '@syncfusion/ej2-base';import { Component, EventHandler, BaseEventArgs, Property, Complex, Event } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty } from '@syncfusion/ej2-base';import { KeyboardEventArgs, EmitType, compile, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Animation, AnimationOptions, Effect, rippleEffect, Touch, SwipeEventArgs } from '@syncfusion/ej2-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { createCheckBox } from '@syncfusion/ej2-buttons';import { ListBase, ListBaseOptions, SortOrder, getFieldValues, FieldsMapping } from '../common/list-base';
|
|
1
|
+
import { Virtualization } from './virtualization';import { merge, formatUnit, isNullOrUndefined, append, detach, ModuleDeclaration, extend } from '@syncfusion/ej2-base';import { attributes, addClass, removeClass, prepend, closest, remove } from '@syncfusion/ej2-base';import { Component, EventHandler, BaseEventArgs, Property, Complex, Event } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty } from '@syncfusion/ej2-base';import { KeyboardEventArgs, EmitType, compile, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Animation, AnimationOptions, Effect, rippleEffect, Touch, SwipeEventArgs, animationMode } from '@syncfusion/ej2-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { createCheckBox } from '@syncfusion/ej2-buttons';import { ListBase, ListBaseOptions, SortOrder, getFieldValues, FieldsMapping } from '../common/list-base';
|
|
2
2
|
import {AnimationSettings,checkBoxPosition,SelectEventArgs} from "./list-view";
|
|
3
3
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
4
4
|
|
|
@@ -254,9 +254,9 @@ export interface ListViewModel extends ComponentModel{
|
|
|
254
254
|
* @angularType string | object
|
|
255
255
|
* @reactType string | function | JSX.Element
|
|
256
256
|
* @vueType string | function
|
|
257
|
-
|
|
257
|
+
* @aspType string
|
|
258
258
|
*/
|
|
259
|
-
template?: string;
|
|
259
|
+
template?: string | Function;
|
|
260
260
|
|
|
261
261
|
/**
|
|
262
262
|
* The ListView has an option to custom design the ListView header title with the help of `headerTemplate` property.
|
|
@@ -267,9 +267,9 @@ export interface ListViewModel extends ComponentModel{
|
|
|
267
267
|
* @angularType string | object
|
|
268
268
|
* @reactType string | function | JSX.Element
|
|
269
269
|
* @vueType string | function
|
|
270
|
-
|
|
270
|
+
* @aspType string
|
|
271
271
|
*/
|
|
272
|
-
headerTemplate?: string;
|
|
272
|
+
headerTemplate?: string | Function;
|
|
273
273
|
|
|
274
274
|
/**
|
|
275
275
|
* The ListView has an option to custom design the group header title with the help of `groupTemplate` property.
|
|
@@ -280,9 +280,9 @@ export interface ListViewModel extends ComponentModel{
|
|
|
280
280
|
* @angularType string | object
|
|
281
281
|
* @reactType string | function | JSX.Element
|
|
282
282
|
* @vueType string | function
|
|
283
|
-
|
|
283
|
+
* @aspType string
|
|
284
284
|
*/
|
|
285
|
-
groupTemplate?: string;
|
|
285
|
+
groupTemplate?: string | Function;
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
288
|
* Triggers when we select the list item in the component.
|
|
@@ -331,9 +331,9 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
331
331
|
* @angularType string | object
|
|
332
332
|
* @reactType string | function | JSX.Element
|
|
333
333
|
* @vueType string | function
|
|
334
|
-
|
|
334
|
+
* @aspType string
|
|
335
335
|
*/
|
|
336
|
-
template: string;
|
|
336
|
+
template: string | Function;
|
|
337
337
|
/**
|
|
338
338
|
* The ListView has an option to custom design the ListView header title with the help of `headerTemplate` property.
|
|
339
339
|
*
|
|
@@ -343,9 +343,9 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
343
343
|
* @angularType string | object
|
|
344
344
|
* @reactType string | function | JSX.Element
|
|
345
345
|
* @vueType string | function
|
|
346
|
-
|
|
346
|
+
* @aspType string
|
|
347
347
|
*/
|
|
348
|
-
headerTemplate: string;
|
|
348
|
+
headerTemplate: string | Function;
|
|
349
349
|
/**
|
|
350
350
|
* The ListView has an option to custom design the group header title with the help of `groupTemplate` property.
|
|
351
351
|
*
|
|
@@ -355,9 +355,9 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
355
355
|
* @angularType string | object
|
|
356
356
|
* @reactType string | function | JSX.Element
|
|
357
357
|
* @vueType string | function
|
|
358
|
-
|
|
358
|
+
* @aspType string
|
|
359
359
|
*/
|
|
360
|
-
groupTemplate: string;
|
|
360
|
+
groupTemplate: string | Function;
|
|
361
361
|
/**
|
|
362
362
|
* Triggers when we select the list item in the component.
|
|
363
363
|
*
|
|
@@ -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
|
|
@@ -635,6 +635,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
635
635
|
}
|
|
636
636
|
};
|
|
637
637
|
ListView.prototype.clickHandler = function (e) {
|
|
638
|
+
if (Array.isArray(this.dataSource) && this.dataSource.length === 0) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
638
641
|
var target = e.target;
|
|
639
642
|
this.targetElement = target;
|
|
640
643
|
var classList = target.classList;
|
|
@@ -1368,18 +1371,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1368
1371
|
if (this.enableVirtualization) {
|
|
1369
1372
|
if (Object.keys(this.dataSource).length) {
|
|
1370
1373
|
if ((this.template || this.groupTemplate) && !this.virtualizationModule.isNgTemplate()) {
|
|
1371
|
-
if (this.isReact || this.isVue) {
|
|
1372
|
-
if (typeof this.template == "string") {
|
|
1373
|
-
this.listBaseOption.template = null;
|
|
1374
|
-
}
|
|
1375
|
-
if (typeof this.groupTemplate == "string") {
|
|
1376
|
-
this.listBaseOption.groupTemplate = null;
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
else {
|
|
1380
|
-
this.listBaseOption.template = null;
|
|
1381
|
-
this.listBaseOption.groupTemplate = null;
|
|
1382
|
-
}
|
|
1383
1374
|
this.listBaseOption.itemCreated = this.virtualizationModule.createUIItem.bind(this.virtualizationModule);
|
|
1384
1375
|
}
|
|
1385
1376
|
}
|
|
@@ -1412,7 +1403,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1412
1403
|
*/
|
|
1413
1404
|
ListView.prototype.render = function () {
|
|
1414
1405
|
this.element.classList.add(classNames.root);
|
|
1415
|
-
attributes(this.element, {
|
|
1406
|
+
attributes(this.element, { tabindex: '0' });
|
|
1416
1407
|
this.setCSSClass();
|
|
1417
1408
|
this.setEnableRTL();
|
|
1418
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';
|