@syncfusion/ej2-lists 23.1.43 → 24.1.41
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 +0 -8
- 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 +105 -244
- package/dist/es6/ej2-lists.es2015.js.map +1 -1
- package/dist/es6/ej2-lists.es5.js +101 -241
- 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 +10 -9
- package/src/common/list-base.js +12 -14
- package/src/list-view/list-view-model.d.ts +8 -1
- package/src/list-view/list-view.d.ts +34 -0
- package/src/list-view/list-view.js +32 -35
- package/src/list-view/virtualization.d.ts +1 -8
- package/src/list-view/virtualization.js +57 -192
- package/styles/bootstrap4.css +2 -2
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/bootstrap5.css +1 -1
- package/styles/list-view/_bootstrap4-definition.scss +2 -2
- package/styles/list-view/_bootstrap5-definition.scss +1 -1
- package/styles/list-view/_material-definition.scss +1 -1
- package/styles/list-view/_material3-definition.scss +1 -1
- package/styles/list-view/_tailwind-definition.scss +2 -2
- package/styles/list-view/bootstrap4.css +2 -2
- package/styles/list-view/bootstrap5-dark.css +1 -1
- package/styles/list-view/bootstrap5.css +1 -1
- package/styles/list-view/material.css +1 -1
- package/styles/list-view/material3-dark.css +1 -1
- package/styles/list-view/material3.css +1 -1
- package/styles/list-view/tailwind-dark.css +4 -4
- package/styles/list-view/tailwind.css +4 -4
- package/styles/material.css +1 -1
- package/styles/material3-dark.css +1 -1
- package/styles/material3.css +1 -1
- package/styles/tailwind-dark.css +4 -4
- package/styles/tailwind.css +4 -4
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 24.1.41
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. 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@23.
|
|
3
|
+
"_id": "@syncfusion/ej2-lists@18.23.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-Y3F0KoZWgxh9u2cSw8LEDil8gsJ8+U5ZR7quXXZK5XPnl5h/N9odTSJL1JNVZ4JsHFeQ9KVPcYLpriRR13hh2Q==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-lists",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -35,18 +35,19 @@
|
|
|
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.23.0.tgz",
|
|
39
|
+
"_shasum": "40baa4c2521330f716aec8e70ca9b8a5ca36f6a0",
|
|
40
40
|
"_spec": "@syncfusion/ej2-lists@*",
|
|
41
|
-
"_where": "/jenkins/workspace/elease-
|
|
41
|
+
"_where": "/jenkins/workspace/elease-automation_release_24.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": "~24.1.41",
|
|
48
|
+
"@syncfusion/ej2-buttons": "~24.1.41",
|
|
49
|
+
"@syncfusion/ej2-data": "~24.1.41",
|
|
50
|
+
"@syncfusion/ej2-popups": "~24.1.41"
|
|
50
51
|
},
|
|
51
52
|
"deprecated": false,
|
|
52
53
|
"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 +87,7 @@
|
|
|
86
87
|
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/lists"
|
|
87
88
|
},
|
|
88
89
|
"typings": "index.d.ts",
|
|
89
|
-
"version": "
|
|
90
|
+
"version": "24.1.41",
|
|
90
91
|
"sideEffects": false,
|
|
91
92
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
92
93
|
}
|
package/src/common/list-base.js
CHANGED
|
@@ -280,17 +280,23 @@ 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
|
|
283
|
+
if (ariaAttributes.groupItemRole === 'presentation' || ariaAttributes.itemRole === 'presentation') {
|
|
284
284
|
li.removeAttribute('aria-level');
|
|
285
285
|
}
|
|
286
286
|
anchorElement = li.querySelector('.' + cssClass.anchorWrap);
|
|
287
287
|
// eslint-disable-next-line no-prototype-builtins
|
|
288
288
|
if (fieldData.hasOwnProperty(fields.tooltip)) {
|
|
289
|
-
|
|
289
|
+
var tooltipText = SanitizeHtmlHelper.sanitize(fieldData[fields.tooltip]);
|
|
290
|
+
li.setAttribute('title', tooltipText);
|
|
290
291
|
}
|
|
291
292
|
// eslint-disable-next-line no-prototype-builtins
|
|
292
293
|
if (fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) {
|
|
293
|
-
|
|
294
|
+
var htmlAttributes = fieldData[fields.htmlAttributes];
|
|
295
|
+
// Check if 'class' attribute is present and not an empty string
|
|
296
|
+
if (htmlAttributes.hasOwnProperty('class') && typeof htmlAttributes['class'] === 'string' && htmlAttributes['class'].trim() === '') {
|
|
297
|
+
delete htmlAttributes['class'];
|
|
298
|
+
}
|
|
299
|
+
setAttribute(li, htmlAttributes);
|
|
294
300
|
}
|
|
295
301
|
// eslint-disable-next-line no-prototype-builtins
|
|
296
302
|
if (fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled] === false) {
|
|
@@ -508,7 +514,6 @@ export var ListBase;
|
|
|
508
514
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
509
515
|
var fields = extend({}, ListBase.defaultMappedFields, curOpt.fields);
|
|
510
516
|
var curEle = element.cloneNode(true);
|
|
511
|
-
// eslint-disable-next-line
|
|
512
517
|
var jsonAr = [];
|
|
513
518
|
curEle.classList.add('json-parent');
|
|
514
519
|
var childs = curEle.querySelectorAll('.json-parent>li');
|
|
@@ -517,7 +522,6 @@ export var ListBase;
|
|
|
517
522
|
var li = childs[i];
|
|
518
523
|
var anchor = li.querySelector('a');
|
|
519
524
|
var ul = li.querySelector('ul');
|
|
520
|
-
// eslint-disable-next-line
|
|
521
525
|
var json = {};
|
|
522
526
|
var childNodes = anchor ? anchor.childNodes : li.childNodes;
|
|
523
527
|
var keys = Object.keys(childNodes);
|
|
@@ -591,7 +595,6 @@ export var ListBase;
|
|
|
591
595
|
var ulElement = createElement('ul', { className: cssClass.ul, attrs: { role: 'presentation' } });
|
|
592
596
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
593
597
|
var curFields = extend({}, ListBase.defaultMappedFields, fields);
|
|
594
|
-
// eslint-disable-next-line
|
|
595
598
|
var compiledString = compileTemplate(template);
|
|
596
599
|
var liCollection = [];
|
|
597
600
|
var value;
|
|
@@ -640,7 +643,7 @@ export var ListBase;
|
|
|
640
643
|
else {
|
|
641
644
|
var currentID = isHeader ? curOpt.groupTemplateID : curOpt.templateID;
|
|
642
645
|
if (isHeader) {
|
|
643
|
-
if (componentInstance && componentInstance.getModuleName()
|
|
646
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
644
647
|
// eslint-disable-next-line
|
|
645
648
|
var compiledElement = compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate, null, li);
|
|
646
649
|
if (compiledElement) {
|
|
@@ -698,7 +701,6 @@ export var ListBase;
|
|
|
698
701
|
function renderGroupTemplate(groupTemplate, groupDataSource, fields,
|
|
699
702
|
// eslint-disable-next-line
|
|
700
703
|
headerItems, options, componentInstance) {
|
|
701
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
702
704
|
var compiledString = compileTemplate(groupTemplate);
|
|
703
705
|
var curFields = extend({}, ListBase.defaultMappedFields, fields);
|
|
704
706
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
@@ -708,7 +710,7 @@ export var ListBase;
|
|
|
708
710
|
var headerData = {};
|
|
709
711
|
headerData["" + category] = header.textContent;
|
|
710
712
|
header.innerHTML = '';
|
|
711
|
-
if (componentInstance && componentInstance.getModuleName() !==
|
|
713
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
712
714
|
// eslint-disable-next-line
|
|
713
715
|
var compiledElement = compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, header);
|
|
714
716
|
if (compiledElement) {
|
|
@@ -744,7 +746,6 @@ export var ListBase;
|
|
|
744
746
|
// Create expand and collapse node
|
|
745
747
|
if (!!options.expandCollapse && hasChildren && !options.template) {
|
|
746
748
|
element.firstElementChild.classList.add(cssClass.iconWrapper);
|
|
747
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
748
749
|
var expandElement = options.expandIconPosition === 'Left' ? prepend : append;
|
|
749
750
|
expandElement([createElement('div', { className: 'e-icons ' + options.expandIconClass })], element.querySelector('.' + cssClass.textContent));
|
|
750
751
|
}
|
|
@@ -890,9 +891,8 @@ export var ListBase;
|
|
|
890
891
|
li.setAttribute('data-uid', generateId());
|
|
891
892
|
}
|
|
892
893
|
if (grpLI && options && options.groupTemplate) {
|
|
893
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
894
894
|
var compiledString = compileTemplate(options.groupTemplate);
|
|
895
|
-
if (componentInstance && componentInstance.getModuleName() !==
|
|
895
|
+
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
896
896
|
// eslint-disable-next-line
|
|
897
897
|
var compiledElement = compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate, null, li);
|
|
898
898
|
if (compiledElement) {
|
|
@@ -904,7 +904,6 @@ export var ListBase;
|
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
else if (!grpLI && options && options.template) {
|
|
907
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
908
907
|
var compiledString = compileTemplate(options.template);
|
|
909
908
|
if (componentInstance && componentInstance.getModuleName() !== 'listview') {
|
|
910
909
|
// eslint-disable-next-line
|
|
@@ -976,7 +975,6 @@ export var ListBase;
|
|
|
976
975
|
function generateIcon(createElement, liElement, className, options) {
|
|
977
976
|
var curOpt = extend({}, defaultListBaseOptions, options);
|
|
978
977
|
cssClass = getModuleClass(curOpt.moduleName);
|
|
979
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
980
978
|
var expandElement = curOpt.expandIconPosition === 'Left' ? prepend : append;
|
|
981
979
|
expandElement([createElement('div', {
|
|
982
980
|
className: 'e-icons ' + curOpt.expandIconClass + ' ' +
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
-
import {AnimationSettings,checkBoxPosition,SelectEventArgs} from "./list-view";
|
|
2
|
+
import {AnimationSettings,checkBoxPosition,SelectEventArgs,ScrolledEventArgs} from "./list-view";
|
|
3
3
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -314,4 +314,11 @@ export interface ListViewModel extends ComponentModel{
|
|
|
314
314
|
*/
|
|
315
315
|
actionFailure?: EmitType<MouseEvent>;
|
|
316
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Triggers when scrollbar of the ListView component reaches to the top or bottom.
|
|
319
|
+
*
|
|
320
|
+
* @event 'object'
|
|
321
|
+
*/
|
|
322
|
+
scroll?: EmitType<ScrolledEventArgs>;
|
|
323
|
+
|
|
317
324
|
}
|
|
@@ -167,6 +167,7 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
167
167
|
private enabledItems;
|
|
168
168
|
private disabledItems;
|
|
169
169
|
private isOffline;
|
|
170
|
+
private previousScrollTop;
|
|
170
171
|
/**
|
|
171
172
|
* The `cssClass` property is used to add a user-preferred class name in the root element of the ListView,
|
|
172
173
|
* using which we can customize the component (both CSS and functionality customization)
|
|
@@ -383,6 +384,12 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
383
384
|
*
|
|
384
385
|
*/
|
|
385
386
|
actionFailure: EmitType<MouseEvent>;
|
|
387
|
+
/**
|
|
388
|
+
* Triggers when scrollbar of the ListView component reaches to the top or bottom.
|
|
389
|
+
*
|
|
390
|
+
* @event 'object'
|
|
391
|
+
*/
|
|
392
|
+
scroll: EmitType<ScrolledEventArgs>;
|
|
386
393
|
/**
|
|
387
394
|
* Constructor for creating the widget
|
|
388
395
|
*
|
|
@@ -584,6 +591,7 @@ export declare class ListView extends Component<HTMLElement> implements INotifyP
|
|
|
584
591
|
private findParent;
|
|
585
592
|
protected getModuleName(): string;
|
|
586
593
|
requiredModules(): ModuleDeclaration[];
|
|
594
|
+
private onListScroll;
|
|
587
595
|
/**
|
|
588
596
|
* Get the properties to be maintained in the persisted state.
|
|
589
597
|
*/
|
|
@@ -648,6 +656,15 @@ export interface ListSelectedItem {
|
|
|
648
656
|
*/
|
|
649
657
|
parentId?: string[];
|
|
650
658
|
}
|
|
659
|
+
/**
|
|
660
|
+
* An enum type that denotes the ListView scroll direction when it reaches the end.
|
|
661
|
+
* ```props
|
|
662
|
+
* Top:- The scrollbar is moved upwards.
|
|
663
|
+
* Bottom:- The scrollbar is moved downwards.
|
|
664
|
+
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
export declare type direction = 'Top' | 'Bottom';
|
|
651
668
|
/**
|
|
652
669
|
* An interface that holds selected item.
|
|
653
670
|
*/
|
|
@@ -785,6 +802,23 @@ export interface SelectEventArgs extends BaseEventArgs, SelectedItem {
|
|
|
785
802
|
*/
|
|
786
803
|
cancel: boolean;
|
|
787
804
|
}
|
|
805
|
+
/**
|
|
806
|
+
* An interface that holds scrolled event arguments
|
|
807
|
+
*/
|
|
808
|
+
export interface ScrolledEventArgs {
|
|
809
|
+
/**
|
|
810
|
+
* Specifies the direction “Top” or “Bottom” in which the scrolling occurs.
|
|
811
|
+
*/
|
|
812
|
+
scrollDirection: direction;
|
|
813
|
+
/**
|
|
814
|
+
* Specifies the default scroll event arguments.
|
|
815
|
+
*/
|
|
816
|
+
originalEvent: Event;
|
|
817
|
+
/**
|
|
818
|
+
* Specifies the distance from the scrollbar to the top and bottom ends.
|
|
819
|
+
*/
|
|
820
|
+
distanceY: number;
|
|
821
|
+
}
|
|
788
822
|
/**
|
|
789
823
|
* An interface that holds item created event arguments
|
|
790
824
|
*/
|
|
@@ -314,7 +314,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
314
314
|
this.headerEle.appendChild(hedBackButton);
|
|
315
315
|
this.headerEle.appendChild(textEle);
|
|
316
316
|
if (this.headerTemplate) {
|
|
317
|
-
// eslint-disable-next-line
|
|
318
317
|
var compiledString = compile(this.headerTemplate);
|
|
319
318
|
var headerTemplateEle = this.createElement('div', { className: classNames.headerTemplateText });
|
|
320
319
|
// eslint-disable-next-line
|
|
@@ -434,7 +433,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
434
433
|
itemCreated: this.renderCheckbox.bind(this),
|
|
435
434
|
templateID: "" + this.element.id + LISTVIEW_TEMPLATE_PROPERTY,
|
|
436
435
|
groupTemplateID: "" + this.element.id + LISTVIEW_GROUPTEMPLATE_PROPERTY,
|
|
437
|
-
enableHtmlSanitizer: this.enableHtmlSanitizer
|
|
436
|
+
enableHtmlSanitizer: this.enableHtmlSanitizer
|
|
438
437
|
};
|
|
439
438
|
this.initialization();
|
|
440
439
|
};
|
|
@@ -476,8 +475,8 @@ var ListView = /** @class */ (function (_super) {
|
|
|
476
475
|
if (typeof this.dataSource[0] !== 'string' && typeof this.dataSource[0] !== 'number') {
|
|
477
476
|
fieldData_1 = getFieldValues(args.curData, this.listBaseOption.fields);
|
|
478
477
|
if (this.enablePersistence && !isNullOrUndefined(this.selectedId)) {
|
|
479
|
-
var index = this.selectedId.findIndex(function (e) { return e
|
|
480
|
-
if (index
|
|
478
|
+
var index = this.selectedId.findIndex(function (e) { return e === fieldData_1[_this.listBaseOption.fields.id].toString(); });
|
|
479
|
+
if (index !== -1) {
|
|
481
480
|
this.checkInternally(args, checkboxElement);
|
|
482
481
|
}
|
|
483
482
|
}
|
|
@@ -490,7 +489,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
490
489
|
this.checkInternally(args, checkboxElement);
|
|
491
490
|
}
|
|
492
491
|
checkboxElement.setAttribute('aria-checked', frameElement_1.classList.contains(classNames.checked) ? 'true' : 'false');
|
|
493
|
-
checkboxElement.setAttribute('aria-label',
|
|
492
|
+
checkboxElement.setAttribute('aria-label', args.text);
|
|
494
493
|
if (this.checkBoxPosition === 'Left') {
|
|
495
494
|
checkboxElement.classList.add(classNames.checkboxLeft);
|
|
496
495
|
args.item.firstElementChild.classList.add(classNames.checkboxLeft);
|
|
@@ -687,7 +686,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
687
686
|
}
|
|
688
687
|
else {
|
|
689
688
|
this.setCheckboxLI(li, e);
|
|
690
|
-
if ((target.nodeName
|
|
689
|
+
if ((target.nodeName === 'INPUT') || (target.nodeName === 'TEXTAREA')) {
|
|
691
690
|
target.classList.add('e-focused');
|
|
692
691
|
this.targetElement = target;
|
|
693
692
|
}
|
|
@@ -695,7 +694,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
695
694
|
}
|
|
696
695
|
else {
|
|
697
696
|
this.setSelectLI(li, e);
|
|
698
|
-
if ((target.nodeName
|
|
697
|
+
if ((target.nodeName === 'INPUT') || (target.nodeName === 'TEXTAREA')) {
|
|
699
698
|
target.classList.add('e-focused');
|
|
700
699
|
this.targetElement = target;
|
|
701
700
|
}
|
|
@@ -957,6 +956,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
957
956
|
EventHandler.add(this.element, 'mouseout', this.leaveHandler, this);
|
|
958
957
|
EventHandler.add(this.element, 'focusout', this.focusout, this);
|
|
959
958
|
this.touchModule = new Touch(this.element, { swipe: this.swipeActionHandler.bind(this) });
|
|
959
|
+
if (!isNullOrUndefined(this.scroll)) {
|
|
960
|
+
EventHandler.add(this.element, 'scroll', this.onListScroll, this);
|
|
961
|
+
}
|
|
960
962
|
};
|
|
961
963
|
ListView.prototype.unWireEvents = function () {
|
|
962
964
|
EventHandler.remove(this.element, 'click', this.clickHandler);
|
|
@@ -964,6 +966,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
964
966
|
EventHandler.remove(this.element, 'mouseout', this.leaveHandler);
|
|
965
967
|
EventHandler.remove(this.element, 'mouseover', this.hoverHandler);
|
|
966
968
|
EventHandler.remove(this.element, 'mouseout', this.leaveHandler);
|
|
969
|
+
if (!isNullOrUndefined(this.scroll)) {
|
|
970
|
+
EventHandler.remove(this.element, 'scroll', this.onListScroll);
|
|
971
|
+
}
|
|
967
972
|
this.touchModule.destroy();
|
|
968
973
|
this.touchModule = null;
|
|
969
974
|
};
|
|
@@ -1047,7 +1052,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1047
1052
|
}
|
|
1048
1053
|
else {
|
|
1049
1054
|
selectedItem =
|
|
1050
|
-
// eslint-disable-next-line
|
|
1051
1055
|
{
|
|
1052
1056
|
item: li, text: fieldData && fieldData[this.listBaseOption.fields.text],
|
|
1053
1057
|
// eslint-disable-next-line
|
|
@@ -1289,7 +1293,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1289
1293
|
this.removeElement(this.headerEle);
|
|
1290
1294
|
this.removeElement(this.ulElement);
|
|
1291
1295
|
this.removeElement(this.contentContainer);
|
|
1292
|
-
// eslint-disable-next-line
|
|
1293
1296
|
if (this.isReact) {
|
|
1294
1297
|
this.clearTemplate();
|
|
1295
1298
|
}
|
|
@@ -1328,7 +1331,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1328
1331
|
ListView.prototype.UpdateCurrentUL = function () {
|
|
1329
1332
|
this.ulElement = this.curUL = this.element.querySelector('.' + classNames.parentItem);
|
|
1330
1333
|
if (this.curUL) {
|
|
1331
|
-
// eslint-disable-next-line
|
|
1332
1334
|
this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
|
|
1333
1335
|
}
|
|
1334
1336
|
};
|
|
@@ -1343,7 +1345,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1343
1345
|
if (!ele) {
|
|
1344
1346
|
var data = this.curViewDS;
|
|
1345
1347
|
ele = ListBase.createListFromJson(this.createElement, data, this.listBaseOption, this.curDSLevel.length, null, this);
|
|
1346
|
-
// eslint-disable-next-line
|
|
1347
1348
|
if (this.isReact) {
|
|
1348
1349
|
this.renderReactTemplates();
|
|
1349
1350
|
}
|
|
@@ -1357,7 +1358,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1357
1358
|
this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
|
|
1358
1359
|
if (this.selectedItems) {
|
|
1359
1360
|
var fieldData = getFieldValues(this.selectedItems.data, this.listBaseOption.fields);
|
|
1360
|
-
// eslint-disable-next-line
|
|
1361
1361
|
this.header((fieldData[this.listBaseOption.fields.text]), true, 'header');
|
|
1362
1362
|
}
|
|
1363
1363
|
this.selectedLI = undefined;
|
|
@@ -1381,7 +1381,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1381
1381
|
this.contentContainer = this.createElement('div', { className: classNames.container });
|
|
1382
1382
|
this.element.appendChild(this.contentContainer);
|
|
1383
1383
|
this.renderIntoDom(this.ulElement);
|
|
1384
|
-
// eslint-disable-next-line
|
|
1385
1384
|
if (this.isReact) {
|
|
1386
1385
|
this.renderReactTemplates();
|
|
1387
1386
|
}
|
|
@@ -1390,7 +1389,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1390
1389
|
ListView.prototype.getElementUID = function (obj) {
|
|
1391
1390
|
var fields = {};
|
|
1392
1391
|
if (obj instanceof Element) {
|
|
1393
|
-
// eslint-disable-next-line
|
|
1394
1392
|
fields[this.fields.id] = obj.getAttribute('data-uid');
|
|
1395
1393
|
}
|
|
1396
1394
|
else {
|
|
@@ -1416,12 +1414,12 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1416
1414
|
selector: '.' + classNames.listItem
|
|
1417
1415
|
});
|
|
1418
1416
|
this.renderComplete();
|
|
1417
|
+
this.previousScrollTop = this.element.scrollTop;
|
|
1419
1418
|
};
|
|
1420
1419
|
/**
|
|
1421
1420
|
* It is used to destroy the ListView component.
|
|
1422
1421
|
*/
|
|
1423
1422
|
ListView.prototype.destroy = function () {
|
|
1424
|
-
// eslint-disable-next-line
|
|
1425
1423
|
if (this.isReact) {
|
|
1426
1424
|
this.clearTemplate();
|
|
1427
1425
|
}
|
|
@@ -1463,7 +1461,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1463
1461
|
toUL = toUL.parentElement;
|
|
1464
1462
|
}
|
|
1465
1463
|
var fieldData = getFieldValues(this.curDSJSON, this.listBaseOption.fields);
|
|
1466
|
-
// eslint-disable-next-line
|
|
1467
1464
|
var text = fieldData[this.fields.text];
|
|
1468
1465
|
this.switchView(fromUL, toUL, true);
|
|
1469
1466
|
this.removeFocus();
|
|
@@ -1536,7 +1533,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1536
1533
|
if (!this.enableVirtualization && isNullOrUndefined(li)) {
|
|
1537
1534
|
var curLi = this.element.querySelectorAll('.' + classNames.listItem);
|
|
1538
1535
|
for (var i = 0; i < curLi.length; i++) {
|
|
1539
|
-
// eslint-disable-next-line
|
|
1540
1536
|
if (curLi[i].innerText.trim() === fieldData[this.fields.text]) {
|
|
1541
1537
|
li = curLi[i];
|
|
1542
1538
|
}
|
|
@@ -1586,7 +1582,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1586
1582
|
*
|
|
1587
1583
|
*/
|
|
1588
1584
|
ListView.prototype.getSelectedItems = function () {
|
|
1589
|
-
// eslint-disable-next-line
|
|
1590
1585
|
var finalValue;
|
|
1591
1586
|
var isCompleted = false;
|
|
1592
1587
|
this.selectedId = [];
|
|
@@ -1597,7 +1592,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1597
1592
|
isCompleted = true;
|
|
1598
1593
|
}
|
|
1599
1594
|
else if (this.showCheckBox && !isCompleted) {
|
|
1600
|
-
// eslint-disable-next-line
|
|
1601
1595
|
var liCollection = this.curUL.getElementsByClassName(classNames.selected);
|
|
1602
1596
|
var liTextCollection = [];
|
|
1603
1597
|
var liDataCollection = [];
|
|
@@ -1617,9 +1611,7 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1617
1611
|
liDataCollection.push(tempData);
|
|
1618
1612
|
}
|
|
1619
1613
|
if (fieldData) {
|
|
1620
|
-
// eslint-disable-next-line
|
|
1621
1614
|
liTextCollection.push(fieldData[this.listBaseOption.fields.text]);
|
|
1622
|
-
// eslint-disable-next-line
|
|
1623
1615
|
this.selectedId.push(fieldData[this.listBaseOption.fields.id]);
|
|
1624
1616
|
}
|
|
1625
1617
|
else {
|
|
@@ -1661,7 +1653,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1661
1653
|
isCompleted = true;
|
|
1662
1654
|
}
|
|
1663
1655
|
else {
|
|
1664
|
-
// eslint-disable-next-line
|
|
1665
1656
|
this.selectedId.push(fieldData[this.listBaseOption.fields.id]);
|
|
1666
1657
|
finalValue = {
|
|
1667
1658
|
text: fieldData[this.listBaseOption.fields.text], item: liElement,
|
|
@@ -1719,7 +1710,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1719
1710
|
if (li) {
|
|
1720
1711
|
li.classList.add(classNames.disable);
|
|
1721
1712
|
}
|
|
1722
|
-
// eslint-disable-next-line
|
|
1723
1713
|
resultJSON[this.fields.enabled] = false;
|
|
1724
1714
|
}
|
|
1725
1715
|
}
|
|
@@ -1755,7 +1745,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1755
1745
|
li.style.display = display;
|
|
1756
1746
|
}
|
|
1757
1747
|
if (isHide) {
|
|
1758
|
-
// eslint-disable-next-line
|
|
1759
1748
|
resultJSON[this.fields.isVisible] = false;
|
|
1760
1749
|
}
|
|
1761
1750
|
else {
|
|
@@ -1839,7 +1828,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1839
1828
|
return newDataSource;
|
|
1840
1829
|
};
|
|
1841
1830
|
ListView.prototype.addItemInNestedList = function (targetItemData, itemQueue) {
|
|
1842
|
-
// eslint-disable-next-line
|
|
1843
1831
|
var targetItemId = targetItemData[this.fields.id];
|
|
1844
1832
|
var targetChildDS = targetItemData[this.fields.child];
|
|
1845
1833
|
var isAlreadyRenderedUL = this.element.querySelector('[pid=\'' + targetItemId + '\']');
|
|
@@ -1883,7 +1871,6 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1883
1871
|
this.getLiFromObjOrElement(curViewDS[index + 2]) || null;
|
|
1884
1872
|
var li = ListBase.createListItemFromJson(this.createElement, [dataSource], this.listBaseOption, null, null, this);
|
|
1885
1873
|
this.setAttributes(li);
|
|
1886
|
-
// eslint-disable-next-line
|
|
1887
1874
|
if (this.template && this.isReact) {
|
|
1888
1875
|
this.renderReactTemplates();
|
|
1889
1876
|
}
|
|
@@ -1916,11 +1903,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1916
1903
|
var curViewDS = this.curViewDS;
|
|
1917
1904
|
var fields = obj instanceof Element ? this.getElementUID(obj) : obj;
|
|
1918
1905
|
var dataSource;
|
|
1919
|
-
// eslint-disable-next-line prefer-const
|
|
1920
1906
|
dataSource = this.findItemFromDS(listDataSource, fields, true);
|
|
1921
1907
|
if (dataSource) {
|
|
1922
1908
|
var data_1;
|
|
1923
|
-
// eslint-disable-next-line prefer-const
|
|
1924
1909
|
data_1 = this.findItemFromDS(dataSource, fields);
|
|
1925
1910
|
var index = curViewDS.indexOf(data_1);
|
|
1926
1911
|
var li = this.getLiFromObjOrElement(obj);
|
|
@@ -1941,11 +1926,8 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1941
1926
|
if (groupLi) {
|
|
1942
1927
|
detach(groupLi);
|
|
1943
1928
|
}
|
|
1944
|
-
// eslint-disable-next-line
|
|
1945
1929
|
var foundData = (dataSource.length - 1) <= 0
|
|
1946
|
-
? this.findParent(this.localData, this.fields.id,
|
|
1947
|
-
// eslint-disable-next-line
|
|
1948
|
-
function (value) { return value === data_1[_this.fields.id]; }, null) : null;
|
|
1930
|
+
? this.findParent(this.localData, this.fields.id, function (value) { return value === data_1[_this.fields.id]; }, null) : null;
|
|
1949
1931
|
var dsIndex = dataSource.indexOf(data_1);
|
|
1950
1932
|
dataSource.splice(dsIndex, 1);
|
|
1951
1933
|
this.setViewDataSource(listDataSource);
|
|
@@ -1988,16 +1970,13 @@ var ListView = /** @class */ (function (_super) {
|
|
|
1988
1970
|
}
|
|
1989
1971
|
}
|
|
1990
1972
|
};
|
|
1991
|
-
// eslint-disable-next-line
|
|
1992
1973
|
ListView.prototype.findParent = function (dataSource, id, callback, parent) {
|
|
1993
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
1994
1974
|
if (dataSource.hasOwnProperty(id) && callback(dataSource[id]) === true) {
|
|
1995
1975
|
return extend({}, dataSource);
|
|
1996
1976
|
}
|
|
1997
1977
|
for (var i = 0; i < Object.keys(dataSource).length; i++) {
|
|
1998
1978
|
if (dataSource[Object.keys(dataSource)[i]]
|
|
1999
1979
|
&& typeof dataSource[Object.keys(dataSource)[i]] === 'object') {
|
|
2000
|
-
// eslint-disable-next-line
|
|
2001
1980
|
var result = this.findParent(dataSource[Object.keys(dataSource)[i]], id, callback, dataSource);
|
|
2002
1981
|
if (result != null) {
|
|
2003
1982
|
if (!result.parent) {
|
|
@@ -2020,6 +1999,21 @@ var ListView = /** @class */ (function (_super) {
|
|
|
2020
1999
|
}
|
|
2021
2000
|
return modules;
|
|
2022
2001
|
};
|
|
2002
|
+
ListView.prototype.onListScroll = function (e) {
|
|
2003
|
+
var args = { originalEvent: e, scrollDirection: "Bottom", distanceY: this.element.scrollHeight - this.element.scrollTop };
|
|
2004
|
+
var currentScrollTop = this.element.scrollTop;
|
|
2005
|
+
if (currentScrollTop > this.previousScrollTop) {
|
|
2006
|
+
args.scrollDirection = "Bottom";
|
|
2007
|
+
args.distanceY = this.element.scrollHeight - this.element.clientHeight - this.element.scrollTop;
|
|
2008
|
+
this.trigger('scroll', args);
|
|
2009
|
+
}
|
|
2010
|
+
else if (this.previousScrollTop > currentScrollTop) {
|
|
2011
|
+
args.scrollDirection = "Top";
|
|
2012
|
+
args.distanceY = this.element.scrollTop;
|
|
2013
|
+
this.trigger('scroll', args);
|
|
2014
|
+
}
|
|
2015
|
+
this.previousScrollTop = currentScrollTop;
|
|
2016
|
+
};
|
|
2023
2017
|
/**
|
|
2024
2018
|
* Get the properties to be maintained in the persisted state.
|
|
2025
2019
|
*/
|
|
@@ -2100,6 +2094,9 @@ var ListView = /** @class */ (function (_super) {
|
|
|
2100
2094
|
__decorate([
|
|
2101
2095
|
Event()
|
|
2102
2096
|
], ListView.prototype, "actionFailure", void 0);
|
|
2097
|
+
__decorate([
|
|
2098
|
+
Event()
|
|
2099
|
+
], ListView.prototype, "scroll", void 0);
|
|
2103
2100
|
ListView = __decorate([
|
|
2104
2101
|
NotifyPropertyChanges
|
|
2105
2102
|
], ListView);
|
|
@@ -10,7 +10,6 @@ export interface ElementContext extends HTMLElement {
|
|
|
10
10
|
export declare class Virtualization {
|
|
11
11
|
constructor(instance: ListView);
|
|
12
12
|
private listViewInstance;
|
|
13
|
-
private headerData;
|
|
14
13
|
private templateData;
|
|
15
14
|
private topElementHeight;
|
|
16
15
|
private bottomElementHeight;
|
|
@@ -31,9 +30,6 @@ export declare class Virtualization {
|
|
|
31
30
|
private uiIndices;
|
|
32
31
|
private listDiff;
|
|
33
32
|
private elementDifference;
|
|
34
|
-
private templateFunction;
|
|
35
|
-
private groupTemplateFunction;
|
|
36
|
-
private commonTemplate;
|
|
37
33
|
/**
|
|
38
34
|
* For internal use only.
|
|
39
35
|
*
|
|
@@ -80,9 +76,6 @@ export declare class Virtualization {
|
|
|
80
76
|
addItem(data: DataSource[], fields: Fields, dataSource: DataSource[], index: number): void;
|
|
81
77
|
private createAndInjectNewItem;
|
|
82
78
|
createUIItem(args: ItemCreatedArgs): void;
|
|
83
|
-
private compileTemplate;
|
|
84
|
-
private onChange;
|
|
85
|
-
private updateContextData;
|
|
86
79
|
reRenderUiVirtualization(): void;
|
|
87
80
|
private updateUI;
|
|
88
81
|
/**
|
|
@@ -92,7 +85,7 @@ export declare class Virtualization {
|
|
|
92
85
|
* @param {ElementContext} listElement - The HTML element context for the list view.
|
|
93
86
|
* @param {Virtualization} virtualThis - The virtualization context for the list view.
|
|
94
87
|
*/
|
|
95
|
-
private
|
|
88
|
+
private onChange;
|
|
96
89
|
private onNgChange;
|
|
97
90
|
getModuleName(): string;
|
|
98
91
|
destroy(): void;
|